Skip to content

Commit

Permalink
Merge pull request #344 from vtex-apps/bugfix/fix-allowredirect-on-pr…
Browse files Browse the repository at this point in the history
…oductSearch-and-productSuggestion-queries

Bugfix/fix allowredirect on product search and product suggestion queries
  • Loading branch information
hiagolcm authored Feb 17, 2022
2 parents e343c6e + 6d7a93d commit 6cf2b0b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Fixed
- `productSearch` query ignores the `allowRedirect` property.
- `productSuggestions` doesn't return any result when there is a redirect set.

## [1.61.3] - 2022-02-03

### Fixed
Expand Down
4 changes: 3 additions & 1 deletion node/resolvers/search/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,7 @@ export const queries = {
...args,
query: fullText,
sort: convertOrderBy(args.orderBy),
...args.options,
...workspaceSearchParams,
}

Expand Down Expand Up @@ -639,8 +640,9 @@ export const queries = {
query: args.fullText,
from: 0,
to: 4,
...workspaceSearchParams,
sort: convertOrderBy(args.orderBy),
allowRedirect: false, // When there is a redirect, no product is returned.
...workspaceSearchParams,
}

// unnecessary field. It's is an object and breaks the @vtex/api cache
Expand Down

0 comments on commit 6cf2b0b

Please sign in to comment.