mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-22 04:31:15 +10:00
fix: add no-prisma-delete lint
This commit is contained in:
@ -17,6 +17,10 @@ export default defineEventHandler<{
|
||||
|
||||
const body = await readDropValidatedBody(h3, DeleteInvite);
|
||||
|
||||
await prisma.invitation.delete({ where: { id: body.id } });
|
||||
const { count } = await prisma.invitation.deleteMany({
|
||||
where: { id: body.id },
|
||||
});
|
||||
if (count == 0)
|
||||
throw createError({ statusCode: 404, message: "Invitation not found." });
|
||||
return {};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user