diff --git a/src/composables/useWishlistStore.ts b/src/composables/useWishlistStore.ts index 71ccfbf..9177509 100644 --- a/src/composables/useWishlistStore.ts +++ b/src/composables/useWishlistStore.ts @@ -3,11 +3,11 @@ import { Wishlist, WishlistItem } from '@/types' import { ref } from 'vue' const { client } = useAxios() -const refState = ref({}) +const list = ref(null) const fetch = async (slugText: string): Promise => { const { data } = await client.get(`/wishlist/${slugText}`) - refState.value = data + list.value = data } const updateItem = async (item: WishlistItem): Promise => { @@ -16,7 +16,7 @@ const updateItem = async (item: WishlistItem): Promise => { export const useWishlistStore = () => { return { - list: refState, + list, fetch, updateItem, }