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:
@@ -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" });
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user