Skip to content

Commit

Permalink
fix(vtex): wishlist loader (#918)
Browse files Browse the repository at this point in the history
  • Loading branch information
viktormarinho authored Oct 11, 2024
1 parent c6659cb commit 7e4bf11
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 3 additions & 3 deletions shopify/loaders/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ const buildProxyRoutes = (
ctx: AppContext;
},
) => {
const urlToUse = publicUrl ?
new URL(publicUrl.startsWith("http") ? publicUrl : `https://${publicUrl}`) :
new URL(`https://${storeName}.myshopify.com`);
const urlToUse = publicUrl
? new URL(publicUrl.startsWith("http") ? publicUrl : `https://${publicUrl}`)
: new URL(`https://${storeName}.myshopify.com`);

const hostname = urlToUse.hostname;

Expand Down
3 changes: 1 addition & 2 deletions vtex/actions/wishlist/addItem.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import wishlistLoader from "../../loaders/wishlist.ts";
import { AppContext } from "../../mod.ts";
import type { WishlistItem } from "../../utils/types.ts";
import { parseCookie } from "../../utils/vtexId.ts";
Expand Down Expand Up @@ -32,7 +31,7 @@ const action = async (
`mutation AddToWishlist($listItem: ListItemInputType!, $shopperId: String!, $name: String!, $public: Boolean) { addToList(listItem: $listItem, shopperId: $shopperId, name: $name, public: $public) @context(provider: "[email protected]") }`,
}, { headers: { cookie } });

return wishlistLoader({ count: Infinity }, req, ctx);
return ctx.invoke.vtex.loaders.wishlist({ allRecords: true });
};

export default action;

0 comments on commit 7e4bf11

Please sign in to comment.