diff --git a/shopify/loaders/ProductListingPage.ts b/shopify/loaders/ProductListingPage.ts index 0997cee8d..6986070f8 100644 --- a/shopify/loaders/ProductListingPage.ts +++ b/shopify/loaders/ProductListingPage.ts @@ -217,9 +217,9 @@ export const cacheKey = (props: Props, req: Request): string | null => { startCursor, sort, }); - + url.searchParams.forEach((value, key) => { - if(!key.startsWith("filter.")) return; + if (!key.startsWith("filter.")) return; searchParams.append(key, value); }); diff --git a/vtex/loaders/product/extend.ts b/vtex/loaders/product/extend.ts index 1c201f30c..4fb47a50e 100644 --- a/vtex/loaders/product/extend.ts +++ b/vtex/loaders/product/extend.ts @@ -17,7 +17,6 @@ export interface Props { * @description Adds brand information to products, useful for Intelligent Search loaders. */ brands?: boolean; - products: Product[]; } diff --git a/vtex/loaders/proxy.ts b/vtex/loaders/proxy.ts index 0a5263ac5..4843fb68e 100644 --- a/vtex/loaders/proxy.ts +++ b/vtex/loaders/proxy.ts @@ -27,6 +27,7 @@ const buildProxyRoutes = ( includeSiteMap, generateDecoSiteMap, excludePathsFromDecoSiteMap, + excludePathsFromVtexProxy, includeScriptsToHead, }: { publicUrl?: string; @@ -34,6 +35,7 @@ const buildProxyRoutes = ( includeSiteMap?: string[]; generateDecoSiteMap?: boolean; excludePathsFromDecoSiteMap: string[]; + excludePathsFromVtexProxy?: string[]; includeScriptsToHead?: { includes?: Script[]; }; @@ -91,7 +93,10 @@ const buildProxyRoutes = ( }, }); }; - const routesFromPaths = [...PATHS_TO_PROXY, ...extraPaths].map( + const currentPathsToProxy = PATHS_TO_PROXY.filter((path) => + !excludePathsFromVtexProxy?.includes(path) + ); + const routesFromPaths = [...currentPathsToProxy, ...extraPaths].map( routeFromPath, ); @@ -149,6 +154,10 @@ export interface Props { * @title Exclude paths from /deco-sitemap.xml */ excludePathsFromDecoSiteMap?: string[]; + /** + * @title Exclude paths from VTEX PATHS_TO_PROXY + */ + excludePathsFromVtexProxy?: string[]; /** * @title Scripts to include on Html head */ @@ -166,6 +175,7 @@ function loader( includeSiteMap = [], generateDecoSiteMap = true, excludePathsFromDecoSiteMap = [], + excludePathsFromVtexProxy = [], includeScriptsToHead = { includes: [] }, }: Props, _req: Request, @@ -174,6 +184,7 @@ function loader( return buildProxyRoutes({ generateDecoSiteMap, excludePathsFromDecoSiteMap, + excludePathsFromVtexProxy, includeSiteMap, publicUrl: ctx.publicUrl, extraPaths: extraPathsToProxy,