Skip to content

Commit

Permalink
Merge pull request #74 from weni-ai/fix/allow-vtex-intelligent-search…
Browse files Browse the repository at this point in the history
…-locale-query-param

fix: allow vtex intelligent search to receive locale query param
  • Loading branch information
paulobernardoaf committed Sep 10, 2024
2 parents 42c8fb7 + 225b837 commit 964d792
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion flows/actions/send_msg_catalog.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ func (a *SendMsgCatalogAction) Execute(run flows.FlowRun, step flows.Step, logMo
if a.SearchType == "vtex" {
regexLegacy := regexp.MustCompile(`^https:\/\/([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)\.com(\.br)?\/api\/catalog_system\/pub\/products\/search$`)
regexLegacySeller := regexp.MustCompile(`^https:\/\/([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)\.com(\.br)?\/api\/checkout\/pub\/orderForms\/simulation$`)
regexIntelligent := regexp.MustCompile(`^https:\/\/([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)\.com(\.br)?\/api\/io\/_v\/api\/intelligent-search\/product_search(\/)?$`)
regexIntelligent := regexp.MustCompile(`^https:\/\/([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)\.com(\.br)?\/api\/io\/_v\/api\/intelligent-search\/product_search(\/)?([\\?&]([^&=]+)=([^&=]+))?$`)
regexSponsored := regexp.MustCompile(`^https:\/\/([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)\.com(\.br)?\/api\/io\/_v\/api\/intelligent-search\/sponsored_products(\/)?$`)
if regexLegacy.MatchString(evaluatedURL) {
apiType = "legacy"
Expand Down

0 comments on commit 964d792

Please sign in to comment.