From 65f9a7e6e3e434bda540f184329d41c4ff4bac83 Mon Sep 17 00:00:00 2001 From: nickbar01234 Date: Mon, 15 Apr 2024 13:30:08 -0400 Subject: [PATCH] Fix query logic --- src/app/api/file/[fileId]/route.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/app/api/file/[fileId]/route.ts b/src/app/api/file/[fileId]/route.ts index 5ad731be..c7beea90 100644 --- a/src/app/api/file/[fileId]/route.ts +++ b/src/app/api/file/[fileId]/route.ts @@ -34,10 +34,11 @@ export const PATCH = withSession(async ({ params, session, req }) => { const otherFiles = await prisma.file.findMany({ where: { - AND: [ - { NOT: { id: maybeFile?.id } }, - { date: fileRequest.data.date, seniorId: fileData.seniorId }, - ], + date: fileData.date, + seniorId: fileData.seniorId, + id: { + not: fileId, + }, }, });