mirror of
https://github.com/Fluffy-Bean/TastyBites.git
synced 2025-01-14 10:35:19 +00:00
FUCK
This commit is contained in:
parent
42951bab20
commit
7b4cbef983
|
@ -25,7 +25,7 @@ function createCartStore() {
|
||||||
async function addToCart(uuid: string, amount: number) {
|
async function addToCart(uuid: string, amount: number) {
|
||||||
if (get(cart)[uuid] !== undefined) {
|
if (get(cart)[uuid] !== undefined) {
|
||||||
cart.update((cart: Record<string, CartItem>) => {
|
cart.update((cart: Record<string, CartItem>) => {
|
||||||
cart[uuid].amount += amount; // skipcq: JS-0320
|
cart[uuid].amount += amount;
|
||||||
return cart;
|
return cart;
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
@ -63,7 +63,7 @@ function createCartStore() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTotalPrice(): number {
|
function getTotalPrice(): number {
|
||||||
let totalCartPrice: number = 0;
|
let totalCartPrice = 0;
|
||||||
Object.values(get(cart)).forEach((item: CartItem) => {
|
Object.values(get(cart)).forEach((item: CartItem) => {
|
||||||
totalCartPrice += item.amount * item.data.price;
|
totalCartPrice += item.amount * item.data.price;
|
||||||
});
|
});
|
||||||
|
@ -72,7 +72,7 @@ function createCartStore() {
|
||||||
|
|
||||||
function removeByUUID(uuid: string) {
|
function removeByUUID(uuid: string) {
|
||||||
cart.update((cart) => {
|
cart.update((cart) => {
|
||||||
delete cart[uuid];
|
delete cart[uuid]; // skipcq: JS-0320
|
||||||
return cart;
|
return cart;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue