From f0083a1d370448e59a979baba17f070e2c80203c Mon Sep 17 00:00:00 2001 From: timthedev07 Date: Fri, 29 Dec 2023 18:27:48 +0100 Subject: [PATCH] fix --- app/src/server/crud/questions/deleteQuestion.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/app/src/server/crud/questions/deleteQuestion.ts b/app/src/server/crud/questions/deleteQuestion.ts index 674b8ae..0f1983e 100644 --- a/app/src/server/crud/questions/deleteQuestion.ts +++ b/app/src/server/crud/questions/deleteQuestion.ts @@ -19,11 +19,16 @@ export const deleteQuestion = publicProcedure id: quid, questionerId: uid, answered: false, - answers: { - some: { - AND: [{ accepted: false }, { moderated: false }], + OR: [ + { + answers: { + some: { + AND: [{ accepted: false }, { moderated: false }], + }, + }, }, - }, + { answers: { none: {} } }, + ], }, include: { attachments: { select: { objKey: true } } }, });