updates on the dispatch page preview
This commit is contained in:
@@ -29,13 +29,17 @@ export const extractRiders = (previewData) => {
|
||||
map.set(key, { rider_id: riderId, rider_name: riderName, orders: [] });
|
||||
}
|
||||
const entry = map.get(key);
|
||||
(orders || []).forEach((o) => {
|
||||
const oid = o?.orderid != null ? String(o.orderid) : null;
|
||||
(orders || []).forEach((o, oIdx) => {
|
||||
const resolvedOrderId = o?.orderid || o?.bookingno || o?.bookingid || o?.order_id || o?.booking_id || o?.consignment_id || o?.id || `ord-${oIdx + 1}`;
|
||||
const oid = String(resolvedOrderId);
|
||||
if (oid) {
|
||||
if (seenOrderIds.has(oid)) return;
|
||||
seenOrderIds.add(oid);
|
||||
}
|
||||
entry.orders.push(o);
|
||||
entry.orders.push({
|
||||
...o,
|
||||
orderid: resolvedOrderId
|
||||
});
|
||||
});
|
||||
if (!entry.rider_name && riderName) entry.rider_name = riderName;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user