updated the csv file and added the customerDeliveryTime and kitchenPickupTime
This commit is contained in:
@@ -448,14 +448,16 @@ const MultipleOrders = () => {
|
||||
'senderphone*': 'locationcontact',
|
||||
'senderaddress*': 'locationaddress',
|
||||
'receivername*': 'firstname',
|
||||
'receiverphone*': 'contactno',
|
||||
receiverphone: 'contactno',
|
||||
'receiveralternatephone*': 'altcontactno',
|
||||
receiverfulladdress: 'address',
|
||||
receiverlatitude: 'latitude',
|
||||
receiverlongitude: 'longitude',
|
||||
'itemdescription*': 'description',
|
||||
Quantity: 'quantity',
|
||||
' Collect Cash': 'collectionamt'
|
||||
' Collect Cash': 'collectionamt',
|
||||
customerDeliveryTime: 'customerdeliverytime',
|
||||
kitchenPickupTime: 'kitchenpickuptime'
|
||||
};
|
||||
|
||||
const handleFileDirectUpload = (event) => {
|
||||
@@ -490,11 +492,14 @@ const MultipleOrders = () => {
|
||||
return newRow;
|
||||
});
|
||||
|
||||
const missingCols = Object.keys(headerMap).filter(
|
||||
const requiredCols = Object.keys(headerMap).filter((k) => k.trim().endsWith('*'));
|
||||
const missingRequired = requiredCols.filter(
|
||||
(clientCol) => !headers.includes(normalizeHeader(clientCol))
|
||||
);
|
||||
if (missingCols.length > 0) {
|
||||
opentoast(`Missing columns: ${missingCols.join(', ')}`, 'warning');
|
||||
if (missingRequired.length > 0) {
|
||||
opentoast(`Missing required columns: ${missingRequired.join(', ')}`, 'warning', 3000);
|
||||
setUsers([]);
|
||||
return;
|
||||
}
|
||||
|
||||
setUsers(mappedData);
|
||||
|
||||
Reference in New Issue
Block a user