fix(discover): dismissing an artist also dismisses its albums

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jonathan
2026-07-14 23:43:30 +02:00
parent 202fc0db3c
commit a8c1600111
2 changed files with 22 additions and 0 deletions
+8
View File
@@ -19,6 +19,14 @@ export async function POST(request: Request, { params }: { params: Promise<{ id:
if (action === "dismiss") {
await prisma.discoverySuggestion.update({ where: { id }, data: { status: "dismissed" } });
// Dismissing an artist also dismisses its album suggestions, so the whole unified row
// disappears cleanly instead of leaving the artist's albums stranded.
if (s.kind === "artist") {
await prisma.discoverySuggestion.updateMany({
where: { kind: "album", artistMbid: s.artistMbid, status: "pending" },
data: { status: "dismissed" },
});
}
return Response.json({ id, status: "dismissed" });
}