Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: new wishlist compatibility #960

Merged
merged 6 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.0",
"@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.0"
"@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.0":
version: 0.87.0
resolution: "@plentymarkets/shop-api@npm:0.87.0::__archiveUrl=https%3A%2F%2Fnpm.pkg.github.com%2Fdownload%2F%40plentymarkets%2Fshop-api%2F0.87.0%2F8f0145cd36054a8600436655b75d18a721f1eca0"
dependencies:
"@vue-storefront/middleware": "npm:^5.3.2"
axios: "npm:^1.7.7"
consola: "npm:^3.2.3"
checksum: 10c0/1ddbc8aef54221e8793e16e84903c518a67b61b06140b2404c5cfa637356bd395ef0b4874b00190196725e9c897ba762fe6d126a33c4627994e17b10817c14dc
checksum: 10c0/adaf52c58b653d1fe875a8de5230f0b1e31bc1f9c85bce06767a322f498398a33c55a0da5c1000fd6da1047a5f0afb7906fca4cd280f9ed4b65672a726e03fb4
languageName: node
linkType: hard

Expand Down
Loading