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

@ -18,11 +18,13 @@ export default defineEventHandler<{ body: typeof DeleteLibrarySource.infer }>(
const body = await readDropValidatedBody(h3, DeleteLibrarySource);
await prisma.library.delete({
const { count } = await prisma.library.deleteMany({
where: {
id: body.id,
},
});
if (count == 0)
throw createError({ statusCode: 404, message: "Library not found." });
libraryManager.removeLibrary(body.id);
},