mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-22 12:41:10 +10:00
fix: add no-prisma-delete lint
This commit is contained in:
@ -13,10 +13,10 @@ export default defineEventHandler(async (h3) => {
|
||||
statusMessage: "No id in router params",
|
||||
});
|
||||
|
||||
const deleted = await prisma.aPIToken.delete({
|
||||
const { count } = await prisma.aPIToken.deleteMany({
|
||||
where: { id: id, userId: userId, mode: APITokenMode.User },
|
||||
})!;
|
||||
if (!deleted)
|
||||
if (count == 0)
|
||||
throw createError({ statusCode: 404, statusMessage: "Token not found" });
|
||||
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user