1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-01 12:24:28 +01:00

show error if cart update failed

This commit is contained in:
Du Peng 2022-08-26 11:57:53 +02:00
parent 49aa54193d
commit ded92dfb89

View File

@ -39,7 +39,7 @@ const StoreCart: React.FC<StoreCartProps> = ({ onError, currentUser }) => {
e.stopPropagation();
CartAPI.removeItem(cart, item.orderable_id).then(data => {
setCart(data);
});
}).catch(onError);
};
};
@ -50,7 +50,7 @@ const StoreCart: React.FC<StoreCartProps> = ({ onError, currentUser }) => {
return (e: React.BaseSyntheticEvent) => {
CartAPI.setQuantity(cart, item.orderable_id, e.target.value).then(data => {
setCart(data);
});
}).catch(onError);
};
};
@ -82,7 +82,7 @@ const StoreCart: React.FC<StoreCartProps> = ({ onError, currentUser }) => {
const handleChangeMember = (userId: number): void => {
CartAPI.setCustomer(cart, userId).then(data => {
setCart(data);
});
}).catch(onError);
};
/**