online cart

This commit is contained in:
hamid zarghami
2025-12-01 14:12:34 +03:30
parent b536e0dd2d
commit dd18870b85
6 changed files with 183 additions and 37 deletions
+13 -9
View File
@@ -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}`
}