fix(sorting): add the missing the resources columns.

This commit is contained in:
a.bouhuolia
2021-03-06 14:11:28 +02:00
parent 32e5695950
commit b03a27aefb
9 changed files with 84 additions and 7 deletions

View File

@@ -60,6 +60,13 @@ export default class SaleReceipt extends TenantModel {
draft(query) {
query.where('closed_at', null);
},
/**
* Sorting the receipts order by status.
*/
sortByStatus(query, order) {
query.orderByRaw(`CLOSED_AT IS NULL ${order}`);
}
};
}
@@ -196,6 +203,9 @@ export default class SaleReceipt extends TenantModel {
break;
}
},
sortQuery(query, role) {
query.modify('sortByStatus', role.order);
}
}
};
}