update cart
This commit is contained in:
@@ -55,12 +55,12 @@ const StepOtp = ({ phone, slug }: Props) => {
|
||||
const bulkCartItems = Object.entries(items).map(([key, value]) => {
|
||||
if (value.quantity > 0) {
|
||||
return {
|
||||
foodId: key,
|
||||
productId: key,
|
||||
quantity: value.quantity
|
||||
}
|
||||
}
|
||||
return undefined
|
||||
}).filter((item): item is { foodId: string; quantity: number } => item !== undefined)
|
||||
}).filter((item): item is { productId: string; quantity: number } => item !== undefined)
|
||||
if (!!bulkCartItems.length) {
|
||||
mutateBulkCart({ items: bulkCartItems }, {
|
||||
onSuccess: () => {
|
||||
|
||||
Reference in New Issue
Block a user