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 } } }, });