updates on the patch updats on the multiple order
This commit is contained in:
@@ -477,11 +477,14 @@ export default function MultipleOrders() {
|
||||
|
||||
setIsSubmitting(true);
|
||||
try {
|
||||
if (bookings.length > 200) {
|
||||
OpenToast(`Creating ${bookings.length} orders in ${Math.ceil(bookings.length / 200)} batches...`, 'info', 3000);
|
||||
}
|
||||
const res = await createExpressBookingBulk(bookings);
|
||||
if (res?.success) {
|
||||
queryClient.invalidateQueries({ queryKey: ['doormile', 'bookings'] });
|
||||
queryClient.invalidateQueries({ queryKey: ['ordersBulk'] });
|
||||
OpenToast(`${bookings.length} Orders created successfully`, 'success', 2500);
|
||||
OpenToast(`${res.total || bookings.length} orders created successfully`, 'success', 2500);
|
||||
navigate('/doormile/orders');
|
||||
} else {
|
||||
OpenToast(res?.message || 'Bulk order creation failed', 'error', 3500);
|
||||
|
||||
Reference in New Issue
Block a user