prevent duplicated genres are being sent when updating user profile

This commit is contained in:
Nuwan 2024-10-07 08:49:32 +05:30
parent 2afd8500bd
commit 5d171ec016
1 changed files with 2 additions and 2 deletions

View File

@ -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(