date wise order sort
This commit is contained in:
parent
24018d4bdf
commit
bd44ab91b6
@ -816,13 +816,13 @@ export const getProcessingInvoices = async (req, res) => {
|
||||
query.invoiceId = { $regex: invoiceId, $options: "i" };
|
||||
}
|
||||
const invoices = await Invoice.find(query)
|
||||
.sort({ createdAt: -1 })
|
||||
.skip(skip)
|
||||
.limit(limit)
|
||||
.populate({
|
||||
path: "orderId",
|
||||
select: "uniqueId",
|
||||
});
|
||||
})
|
||||
.sort({ "courierstatus_timeline.processing": -1 });
|
||||
|
||||
if (orderId) {
|
||||
const filteredInvoices = invoices.filter(
|
||||
@ -1026,7 +1026,8 @@ export const getDispatchedInvoices = async (req, res) => {
|
||||
.populate({
|
||||
path: "orderId",
|
||||
select: "uniqueId",
|
||||
});
|
||||
})
|
||||
.sort({ "courierstatus_timeline.dispatched": -1 });
|
||||
|
||||
if (orderId) {
|
||||
const filteredInvoices = invoices.filter(
|
||||
@ -1213,7 +1214,8 @@ export const getDeliveredInvoices = async (req, res) => {
|
||||
.populate({
|
||||
path: "orderId",
|
||||
select: "uniqueId",
|
||||
});
|
||||
})
|
||||
.sort({ "courierstatus_timeline.delivered": -1 });
|
||||
|
||||
if (orderId) {
|
||||
const filteredInvoices = invoices.filter(
|
||||
|
Loading…
Reference in New Issue
Block a user