fix: search and pendingOnly get mixed
All checks were successful
Spell Check / Spell Check with Typos (push) Successful in 3s
All checks were successful
Spell Check / Spell Check with Typos (push) Successful in 3s
This commit is contained in:
parent
92762c512d
commit
ccadd5ea55
1 changed files with 30 additions and 33 deletions
|
|
@ -613,10 +613,7 @@ export class LineController extends Controller {
|
|||
@Query() endDate?: Date,
|
||||
) {
|
||||
const where = {
|
||||
OR:
|
||||
query || pendingOnly
|
||||
? [
|
||||
...(queryOrNot<Prisma.QuotationWhereInput[]>(query, [
|
||||
OR: queryOrNot<Prisma.QuotationWhereInput[]>(query, [
|
||||
{ code: { contains: query, mode: "insensitive" } },
|
||||
{ workName: { contains: query, mode: "insensitive" } },
|
||||
{
|
||||
|
|
@ -631,21 +628,7 @@ export class LineController extends Controller {
|
|||
],
|
||||
},
|
||||
},
|
||||
]) || []),
|
||||
...(queryOrNot<Prisma.QuotationWhereInput[]>(!!pendingOnly, [
|
||||
{
|
||||
requestData: {
|
||||
some: {
|
||||
requestDataStatus: "Pending",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
requestData: { none: {} },
|
||||
},
|
||||
]) || []),
|
||||
]
|
||||
: undefined,
|
||||
]),
|
||||
isDebitNote: false,
|
||||
code,
|
||||
payCondition,
|
||||
|
|
@ -667,6 +650,20 @@ export class LineController extends Controller {
|
|||
},
|
||||
}
|
||||
: undefined,
|
||||
AND: pendingOnly
|
||||
? [
|
||||
{
|
||||
requestData: {
|
||||
some: {
|
||||
requestDataStatus: "Pending",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
requestData: { none: {} },
|
||||
},
|
||||
]
|
||||
: undefined,
|
||||
...whereDateQuery(startDate, endDate),
|
||||
} satisfies Prisma.QuotationWhereInput;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue