Curator-Song-Update: Genre-Zuordnungen auch bei leerem Array korrekt übernehmen
This commit is contained in:
@@ -457,7 +457,8 @@ export async function PUT(request: Request) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (effectiveGenreIds && effectiveGenreIds.length > 0) {
|
// Wenn effectiveGenreIds definiert ist, auch leere Arrays übernehmen (löscht alle Zuordnungen).
|
||||||
|
if (effectiveGenreIds !== undefined) {
|
||||||
data.genres = {
|
data.genres = {
|
||||||
set: effectiveGenreIds.map((gId: number) => ({ id: gId }))
|
set: effectiveGenreIds.map((gId: number) => ({ id: gId }))
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user