prevent duplicated genres are being sent when updating user profile
This commit is contained in:
parent
2afd8500bd
commit
5d171ec016
|
|
@ -351,7 +351,7 @@ function JKEditProfile() {
|
|||
|
||||
const handleChange = () => {
|
||||
const params = getValues();
|
||||
|
||||
const uniqueGenres = [...new Set(params.genres.map(genre => genre.genre_id))];
|
||||
const data = {
|
||||
first_name: params.firstName,
|
||||
last_name: params.lastName,
|
||||
|
|
@ -364,7 +364,7 @@ function JKEditProfile() {
|
|||
traditional_band: params.traditionalBand,
|
||||
cowriting: params.cowriting,
|
||||
instruments: params.instruments,
|
||||
genres: params.genres.map(genre => genre.genre_id)
|
||||
genres: uniqueGenres
|
||||
};
|
||||
|
||||
const instrments = params.instruments.filter(
|
||||
|
|
|
|||
Loading…
Reference in New Issue