refactor: query parameter
This commit is contained in:
parent
d373c8dbf9
commit
afa2808a0c
1 changed files with 5 additions and 1 deletions
|
|
@ -597,6 +597,8 @@ export class LineController extends Controller {
|
|||
@Query() pendingOnly?: boolean,
|
||||
@Query() inProgressOnly?: boolean,
|
||||
@Query() historyOnly?: boolean,
|
||||
@Query() successOnly?: boolean,
|
||||
@Query() canceledOnly?: boolean,
|
||||
@Query() urgentFirst?: boolean,
|
||||
@Query() includeRegisteredBranch?: boolean,
|
||||
@Query() code?: string,
|
||||
|
|
@ -636,7 +638,7 @@ export class LineController extends Controller {
|
|||
isDebitNote: false,
|
||||
code,
|
||||
payCondition,
|
||||
quotationStatus: historyOnly ? { in: ["ProcessComplete", "Canceled"] } : status,
|
||||
quotationStatus: successOnly ? "ProcessComplete" : canceledOnly ? "Canceled" : status,
|
||||
customerBranch: {
|
||||
OR: [
|
||||
{ userId: line.user.sub },
|
||||
|
|
@ -656,6 +658,8 @@ export class LineController extends Controller {
|
|||
: undefined,
|
||||
} satisfies Prisma.QuotationWhereInput;
|
||||
|
||||
console.log();
|
||||
|
||||
const [result, total] = await prisma.$transaction([
|
||||
prisma.quotation.findMany({
|
||||
where,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue