Skip to content

Commit

Permalink
fix: vnda proxy fix (#135)
Browse files Browse the repository at this point in the history
* fix: allow proxy for 'cep' route

* chore: remove unused method for getting cart item quantity
  • Loading branch information
leolanavo committed Jun 30, 2023
1 parent a9b30b1 commit ed29762
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
7 changes: 0 additions & 7 deletions commerce/vnda/hooks/useCart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,6 @@ const fetchAndSetRelatedItems = async () => {
cartRelatedItems.value = vndaRelatedItems;
};

const getCartQuantity: UseVNDACartHook["getCartQuantity"] = () => {
if (!cart.value) return 0;

return cart.value.items_count;
};

type Middleware = (
fn: () => Promise<void>,
opts?: { loadingSignal: Signal<boolean> },
Expand Down Expand Up @@ -193,7 +187,6 @@ const state: UseVNDACartHook = {
loading,
shippingLoading,
couponLoading,
getCartQuantity: () => getCartQuantity(),
fetchAndSetCart: () => withPQueue(() => withLoading(() => fetchAndSetCart())),
addItemToCart: (opts) =>
withPQueue(() => withLoading(() => addItemToCart(opts))),
Expand Down
1 change: 1 addition & 0 deletions loaders/vnda/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Route } from "$live/flags/audience.ts";
const PATHS_TO_PROXY = [
"/carrinho",
"/carrinho/*",
"/cep",
"/cep/*",
"/checkout/*",
"/components/*",
Expand Down

0 comments on commit ed29762

Please sign in to comment.