mirror of
https://github.com/Fluffy-Bean/TastyBites.git
synced 2025-06-02 08:23:14 +00:00
Add multiple to cart from item page
This commit is contained in:
parent
3dda6380e5
commit
584ab41f79
2 changed files with 110 additions and 23 deletions
|
@ -47,7 +47,10 @@ function createCartStore() {
|
|||
cart.update((cart: Record<string, CartItem>) => {
|
||||
if (cart[uuid].amount <= 0) {
|
||||
delete cart[uuid]; // skipcq: JS-0320
|
||||
} else if (cart[uuid].amount > 99) {
|
||||
cart[uuid].amount = 99; // skipcq: JS-0320
|
||||
}
|
||||
|
||||
return cart;
|
||||
});
|
||||
}
|
||||
|
@ -103,8 +106,8 @@ Cart.subscribe((value) => {
|
|||
});
|
||||
|
||||
// Debug
|
||||
Cart.subscribe((value) => {
|
||||
console.log(value);
|
||||
});
|
||||
// Cart.subscribe((value) => {
|
||||
// console.log(value);
|
||||
// });
|
||||
|
||||
export default Cart;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue