fix: wrongn condition

This commit is contained in:
Methapon2001 2025-02-24 13:41:51 +07:00
parent 2e38ea22d5
commit 87d9f39290

View file

@ -418,17 +418,20 @@ export class CreditNoteController extends Controller {
const requestWork = await prisma.requestWork.findMany({ const requestWork = await prisma.requestWork.findMany({
where: { where: {
OR: [{ creditNote: null }, { creditNoteId }],
request: { request: {
quotation: { quotation: { id: body.quotationId },
id: body.quotationId,
},
}, },
stepStatus: { AND: [
some: { {
workStatus: RequestWorkStatus.Canceled, OR: [{ creditNote: null }, { creditNoteId }],
}, },
}, {
OR: [
{ request: { requestDataStatus: RequestDataStatus.Canceled } },
{ stepStatus: { some: { workStatus: RequestWorkStatus.Canceled } } },
],
},
],
id: { in: body.requestWorkId }, id: { in: body.requestWorkId },
}, },
include: { include: {