Skip to content

Commit

Permalink
chore: new wishlist compatibility (#960)
Browse files Browse the repository at this point in the history
  • Loading branch information
abocsan-plenty authored Jan 15, 2025
1 parent 9fbf2d2 commit b8b8411
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"lhci:desktop": "lhci collect --config=lighthouserc.desktop.json && lhci assert"
},
"dependencies": {
"@plentymarkets/shop-api": "^0.86.0",
"@plentymarkets/shop-api": "^0.87.1",
"@types/applepayjs": "^14.0.8",
"@types/drift-zoom": "^1.5.2",
"@types/googlepay": "^0.7.6",
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4997,7 +4997,7 @@ __metadata:
"@nuxt/test-utils": "npm:^3.13.1"
"@nuxtjs/turnstile": "npm:^0.8.0"
"@paypal/paypal-js": "npm:8.1.0"
"@plentymarkets/shop-api": "npm:^0.86.0"
"@plentymarkets/shop-api": "npm:^0.87.1"
"@types/applepayjs": "npm:^14.0.8"
"@types/drift-zoom": "npm:^1.5.2"
"@types/googlepay": "npm:^0.7.6"
Expand Down Expand Up @@ -5031,14 +5031,14 @@ __metadata:
languageName: unknown
linkType: soft

"@plentymarkets/shop-api@npm:^0.86.0":
version: 0.86.0
resolution: "@plentymarkets/shop-api@npm:0.86.0::__archiveUrl=https%3A%2F%2Fnpm.pkg.github.com%2Fdownload%2F%40plentymarkets%2Fshop-api%2F0.86.0%2F5bd99dc104eb1b5744354d59ccc603dc573d4446"
"@plentymarkets/shop-api@npm:^0.87.1":
version: 0.87.1
resolution: "@plentymarkets/shop-api@npm:0.87.1::__archiveUrl=https%3A%2F%2Fnpm.pkg.github.com%2Fdownload%2F%40plentymarkets%2Fshop-api%2F0.87.1%2F3710acc6e809530b16348dd17edb6518016a18b8"
dependencies:
"@vue-storefront/middleware": "npm:^5.3.2"
axios: "npm:^1.7.7"
consola: "npm:^3.2.3"
checksum: 10c0/1ddbc8aef54221e8793e16e84903c518a67b61b06140b2404c5cfa637356bd395ef0b4874b00190196725e9c897ba762fe6d126a33c4627994e17b10817c14dc
checksum: 10c0/e939be4e335c28cb5f2f26cda5b968a70a05466583f41d3f6a9af862915680ca4dcbdf6e96a879fdbc97cd4e5141b6fe84ab115ab66dc259d28c1bda55d767e2
languageName: node
linkType: hard

Expand Down

0 comments on commit b8b8411

Please sign in to comment.