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