refactor: resolve caert remove item issue
This commit is contained in:
@@ -34,7 +34,7 @@ const ShoppingCart = () => {
|
|||||||
const handleQuantityChange = async (variantId, designId, quantityChange) => {
|
const handleQuantityChange = async (variantId, designId, quantityChange) => {
|
||||||
const response = await cartFn(variantId, designId, quantityChange);
|
const response = await cartFn(variantId, designId, quantityChange);
|
||||||
console.log(response)
|
console.log(response)
|
||||||
if (response?.status == 200) {
|
if (response?.status == 200 || response?.status == 204) {
|
||||||
setCartItems((prev) => {
|
setCartItems((prev) => {
|
||||||
if (!prev) return prev;
|
if (!prev) return prev;
|
||||||
|
|
||||||
@@ -187,8 +187,8 @@ const ShoppingCart = () => {
|
|||||||
<button
|
<button
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
handleQuantityChange(
|
handleQuantityChange(
|
||||||
item.variant.id,
|
<div className="flex items-start gap-4 mb-4 lg:mb-0 lg:flex-1">
|
||||||
item?.design?.id,
|
<Image
|
||||||
-1
|
-1
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user