online cart
This commit is contained in:
@@ -51,15 +51,19 @@ const StepOtp = ({ phone, slug }: Props) => {
|
||||
}
|
||||
return undefined
|
||||
}).filter((item): item is { foodId: string; quantity: number } => item !== undefined)
|
||||
mutateBulkCart({ items: bulkCartItems }, {
|
||||
onSuccess: () => {
|
||||
clear()
|
||||
window.location.href = `/${slug}`
|
||||
},
|
||||
onError: (error) => {
|
||||
toast(extractErrorMessage(error), 'error')
|
||||
}
|
||||
})
|
||||
if (!!bulkCartItems.length) {
|
||||
mutateBulkCart({ items: bulkCartItems }, {
|
||||
onSuccess: () => {
|
||||
clear()
|
||||
window.location.href = `/${slug}`
|
||||
},
|
||||
onError: (error) => {
|
||||
toast(extractErrorMessage(error), 'error')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
window.location.href = `/${slug}`
|
||||
}
|
||||
} else {
|
||||
window.location.href = `/${slug}`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user