diff --git a/app/api/songs/route.ts b/app/api/songs/route.ts index 0414638..dd753f4 100644 --- a/app/api/songs/route.ts +++ b/app/api/songs/route.ts @@ -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 = { set: effectiveGenreIds.map((gId: number) => ({ id: gId })) };