fix: add no-prisma-delete lint

This commit is contained in:
DecDuck
2025-11-21 23:04:00 +11:00
parent f1fccd9bff
commit 650a3ca98d
18 changed files with 97 additions and 54 deletions

View File

@ -38,16 +38,14 @@ export default defineClientEventHandler(
if (!game)
throw createError({ statusCode: 400, statusMessage: "Invalid game ID" });
const save = await prisma.saveSlot.delete({
const { count } = await prisma.saveSlot.deleteMany({
where: {
id: {
userId: user.id,
gameId: gameId,
index: slotIndex,
},
userId: user.id,
gameId: gameId,
index: slotIndex,
},
});
if (!save)
if (count == 0)
throw createError({ statusCode: 404, statusMessage: "Save not found" });
},
);