fix: empty array cause result to be zero
All checks were successful
Spell Check / Spell Check with Typos (push) Successful in 10s

This commit is contained in:
Methapon2001 2025-02-26 14:13:28 +07:00
parent e2023ab0ed
commit bf9dac8d46

View file

@ -604,7 +604,9 @@ export class LineController extends Controller {
@Query() query = "",
) {
const where = {
OR: [
OR:
query || pendingOnly
? [
...(queryOrNot<Prisma.QuotationWhereInput[]>(query, [
{ code: { contains: query, mode: "insensitive" } },
{ workName: { contains: query } },
@ -633,7 +635,8 @@ export class LineController extends Controller {
requestData: { none: {} },
},
]) || []),
],
]
: undefined,
isDebitNote: false,
code,
payCondition,
@ -657,8 +660,6 @@ export class LineController extends Controller {
: undefined,
} satisfies Prisma.QuotationWhereInput;
console.log();
const [result, total] = await prisma.$transaction([
prisma.quotation.findMany({
where,