Skip to content

Commit

Permalink
front-user: add types
Browse files Browse the repository at this point in the history
  • Loading branch information
alphayax committed Nov 25, 2023
1 parent 1c98688 commit 8277c46
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions front-user/src/store/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 8277c46

Please sign in to comment.