refactor: urgent comes first as parameter
This commit is contained in:
parent
c29193d62c
commit
f06f7366b7
1 changed files with 2 additions and 1 deletions
|
|
@ -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,
|
||||
}),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue