mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-22 20:51:12 +10:00
fix: add no-prisma-delete lint
This commit is contained in:
@ -20,14 +20,14 @@ export default defineEventHandler(async (h3) => {
|
||||
userIds.push("system");
|
||||
}
|
||||
|
||||
const notification = await prisma.notification.delete({
|
||||
const { count } = await prisma.notification.deleteMany({
|
||||
where: {
|
||||
id: notificationId,
|
||||
userId: { in: userIds },
|
||||
},
|
||||
});
|
||||
|
||||
if (!notification)
|
||||
if (count == 0)
|
||||
throw createError({
|
||||
statusCode: 400,
|
||||
statusMessage: "Invalid notification ID",
|
||||
|
||||
Reference in New Issue
Block a user