From 8277c4693ab33772a9e766a4446ab1b2638b66cc Mon Sep 17 00:00:00 2001 From: alphayax Date: Sat, 25 Nov 2023 11:19:31 +0100 Subject: [PATCH] front-user: add types --- front-user/src/store/app.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/front-user/src/store/app.ts b/front-user/src/store/app.ts index 59be48a..a5b5977 100644 --- a/front-user/src/store/app.ts +++ b/front-user/src/store/app.ts @@ -21,12 +21,12 @@ export const useAppStore = defineStore('app', () => { cartItems.value = await fetchCart(cartId.value) } - function addToCart(item) { - cartItems.value.push(item) + function addToCart(itemId: string) { + cartItems.value.push(itemId) } - function removeFromCart(item) { - cartItems.value = cartItems.value.filter((i) => i !== item) + function removeFromCart(itemId: string) { + cartItems.value = cartItems.value.filter((cartItemId) => cartItemId !== itemId) } return {