diff --git a/src/controllers/05-quotation-controller.ts b/src/controllers/05-quotation-controller.ts index 2c9b317..8986757 100644 --- a/src/controllers/05-quotation-controller.ts +++ b/src/controllers/05-quotation-controller.ts @@ -189,6 +189,7 @@ export class QuotationController extends Controller { @Query() pageSize: number = 30, @Query() payCondition?: PayCondition, @Query() status?: QuotationStatus, + @Query() urgentFirst?: boolean, @Query() query = "", ) { const where = { @@ -231,7 +232,7 @@ export class QuotationController extends Controller { createdBy: true, updatedBy: true, }, - orderBy: [{ urgent: "desc" }, { createdAt: "desc" }], + orderBy: urgentFirst ? [{ urgent: "desc" }, { createdAt: "desc" }] : { createdAt: "desc" }, take: pageSize, skip: (page - 1) * pageSize, }),