Skip to content

Commit

Permalink
Merge pull request #341 from vtex-apps/fix/use-full-text
Browse files Browse the repository at this point in the history
Use fullText when query is empty
  • Loading branch information
thalytafabrine authored Feb 14, 2022
2 parents 8565207 + 74737d5 commit 56f7b6a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Fixed
- Use `fullText` when `query` is empty.

## [0.16.12] - 2022-01-04

### Fixed
Expand Down
3 changes: 2 additions & 1 deletion node/clients/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ export class Search extends AppClient {

private productSearchUrl = ({
query = '',
fullText = '',
category = '',
specificationFilters,
priceRange = '',
Expand All @@ -281,7 +282,7 @@ export class Search extends AppClient {
completeSpecifications = true,
}: SearchArgs) => {
const sanitizedQuery = encodeURIComponent(
this.searchEncodeURI(decodeURIComponent(query || '').trim())
this.searchEncodeURI(decodeURIComponent(query || fullText || '').trim())
)
if (hideUnavailableItems) {
const segmentData = (this.context as CustomIOContext).segment
Expand Down
1 change: 1 addition & 0 deletions node/typings/Catalog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ interface SearchArgs extends QueryArgs {
hideUnavailableItems: boolean | null
simulationBehavior: 'skip' | 'default' | null
completeSpecifications: boolean
fullText?: string
}

interface Metadata {
Expand Down

0 comments on commit 56f7b6a

Please sign in to comment.