Skip to content

Commit

Permalink
add get cookie start
Browse files Browse the repository at this point in the history
  • Loading branch information
evertonvargasvtex committed Oct 25, 2024
1 parent a693f8e commit a4ffbef
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/api/src/platforms/vtex/clients/search/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const IntelligentSearch = (
{ account, environment, hideUnavailableItems, simulationBehavior, showSponsored }: Options,
ctx: Context
) => {
console.log("IntelligentSearch faststore", ctx)
console.log("IntelligentSearch faststore", ctx?.headers?.cookie)
const base = `https://${account}.${environment}.com.br/api/io`
const storeCookies = getStoreCookie(ctx)

Expand All @@ -66,6 +66,8 @@ export const IntelligentSearch = (
return match ? match[1] : null;
};

const segmentCookie = ctx ? getVtexSegment(ctx.headers.cookie) : null

const getPolicyFacet = (): IStoreSelectedFacet | null => {
const { salesChannel } = ctx.storage.channel

Expand Down Expand Up @@ -155,8 +157,6 @@ export const IntelligentSearch = (
.map(({ key, value }) => `${key}/${value}`)
.join('/')

const segmentCookie = ctx ? getVtexSegment(ctx.headers.cookie) : null

console.log("search", segmentCookie)

const headers = segmentCookie
Expand Down

0 comments on commit a4ffbef

Please sign in to comment.