I need to convert find many query to find raw query...
@kapa.ai
await this.prisma.incident.findMany({
where: {
title: { contains: filter?.title },
createdDate: {
lte: filter?.created?.date?.end,
gte: filter?.created?.date?.start,
},
modifiedDate: {
lte: filter?.modified?.date?.end,
gte: filter?.modified?.date?.start,
},
...(filter?.severity && filter?.severity.length > 0
? {
severity: { in: filter?.severity },
}
: {}),
...(filter?.status && filter?.status.length > 0
? {
status: { in: filter?.status },
}
: {}),
...(filter?.tags && filter?.tags.length > 0
? {
tags: { hasSome: filter?.tags },
}
: {}),
archive: false,
},
include: {
creator: true,
modifier: true,
notes: { include: { creator: true } },
},
orderBy: sortingData,
});
can you write this in findRaw form?
1 Reply
Hey 👋
You might want to ask this in #ask-ai
Kapa bot would not work in this channel