Skip to content

Commit

Permalink
feat: pass advertisementOptions to suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
hcaula committed Jul 30, 2024
1 parent 521a217 commit d0bc0bf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
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]

### Added

- Pass `advertisementOptions` to Intelligent Search API on the `productSuggestions` query.

## [1.71.0] - 2024-07-09

### Added
Expand Down
3 changes: 3 additions & 0 deletions node/resolvers/search/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,10 @@ export const queries = {
const workspaceSearchParams = await getWorkspaceSearchParamsFromStorage(ctx)
const selectedFacets: SelectedFacet[] = args.facetKey && args.facetValue ? [{key: args.facetKey, value: args.facetValue}] : []

const { advertisementOptions = defaultAdvertisementOptions } = args

const biggyArgs : {[key: string] : any} = {
...advertisementOptions,
...args,
query: args.fullText,
from: 0,
Expand Down
1 change: 1 addition & 0 deletions node/typings/Search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ interface SuggestionProductsArgs {
orderBy?: string
count?: number
shippingOptions?: string[]
advertisementOptions: AdvertisementOptions
}

interface SuggestionSearchesArgs {
Expand Down

0 comments on commit d0bc0bf

Please sign in to comment.