Skip to content

Commit

Permalink
chore: new wishlist compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
abocsan-plenty committed Jan 15, 2025
1 parent 600cced commit f865081
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const cart: Cart = {
"subAmount": 1,
"isExportDelivery": true,
"shopCountryId": 1,
"itemWishListIds": [],
"itemWishListIds": {},
"items": [
{
"id": 1,
Expand Down
2 changes: 1 addition & 1 deletion apps/web/composables/useCustomer/useCustomer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const useCustomer: UseCustomerReturn = () => {
useHandleError(error.value);
state.value.data = data?.value?.data ?? state.value.data;
checkUserState();
useWishlist().setWishlistItemIds(state.value.data?.basket?.itemWishListIds || []);
useWishlist().setWishlistItemIds(Object.keys(state.value.data?.basket?.itemWishListIds || []));

state.value.loading = false;
return state.value.data;
Expand Down
2 changes: 1 addition & 1 deletion apps/web/composables/useInitialSetup/useInitialSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const setInitialDataSSR: SetInitialData = async () => {
setUser(data.value.data.session as SessionResult);
setCart(data.value.data.session?.basket as Cart);
setCategoryTree(data.value.data.categories);
setWishlistItemIds(data.value.data.session?.basket?.itemWishListIds || []);
setWishlistItemIds(Object.keys(data.value.data.session?.basket?.itemWishListIds || []));
}
} catch (error) {
useHandleError(error as ApiError);
Expand Down

0 comments on commit f865081

Please sign in to comment.