Skip to content

Commit

Permalink
skip simulation
Browse files Browse the repository at this point in the history
  • Loading branch information
tlgimenes committed Jun 10, 2022
1 parent f818c05 commit 576e612
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions packages/api/src/platforms/vtex/clients/commerce/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,16 @@ export const VtexCommerce = (
})
},
search: {
slug: (slug: string): Promise<Product[]> => {
slug: (
slug: string,
options?: { simulation: boolean }
): Promise<Product[]> => {
const params = new URLSearchParams({
simulation: `${options?.simulation ?? false}`, // skip simulation for faster queries
})

return fetchAPI(
`${base}/api/catalog_system/pub/products/search/${slug}/p`
`${base}/api/catalog_system/pub/products/search/${slug}/p?${params.toString()}`
)
},
},
Expand Down

0 comments on commit 576e612

Please sign in to comment.