From 91ebaa0e44d21b3704f38a51ecd339c616f7c57a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=B6rdle=20Bot?= Date: Thu, 4 Dec 2025 00:52:16 +0100 Subject: [PATCH] fix: TypeScript-Fehler in batch route behoben MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Non-Null-Assertion für assignments hinzugefügt - assignments ist innerhalb des curator-Blocks garantiert nicht null --- app/api/songs/batch/route.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/api/songs/batch/route.ts b/app/api/songs/batch/route.ts index 3bce117..3f3583a 100644 --- a/app/api/songs/batch/route.ts +++ b/app/api/songs/batch/route.ts @@ -84,8 +84,9 @@ export async function POST(request: Request) { assignments = await getCuratorAssignments(context.curator.id); // Validate genre/special toggles are within curator's assignments + // assignments is guaranteed to be non-null here since we're in the curator block if (hasGenreToggle) { - const invalidGenre = genreToggleIds.some((id: number) => !assignments.genreIds.has(id)); + const invalidGenre = genreToggleIds.some((id: number) => !assignments!.genreIds.has(id)); if (invalidGenre) { return NextResponse.json( { error: 'Curators may only toggle their own genres' }, @@ -95,7 +96,7 @@ export async function POST(request: Request) { } if (hasSpecialToggle) { - const invalidSpecial = specialToggleIds.some((id: number) => !assignments.specialIds.has(id)); + const invalidSpecial = specialToggleIds.some((id: number) => !assignments!.specialIds.has(id)); if (invalidSpecial) { return NextResponse.json( { error: 'Curators may only toggle their own specials' },