Skip to content

Commit

Permalink
fix(commerce): do not set numberOfValues when restoring from url (#…
Browse files Browse the repository at this point in the history
…4618)

This fix is two-fold. First, in headless, we must stop hardcoding the
`numberOfValues` when restoring the facet state from an url.

Then, in the Commerce API, we must fallback to the configured
`numberOfValues`.

[CAPI-1523](https://coveord.atlassian.net/browse/CAPI-1523)

[CAPI-1523]:
https://coveord.atlassian.net/browse/CAPI-1523?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
  • Loading branch information
Spuffynism authored Nov 5, 2024
1 parent 949d6ca commit eb70faf
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ function restoreFacet(facetId: string) {
return {
facetId,
field: facetId,
numberOfValues: 10,
isFieldExpanded: false,
preventAutoSelect: false,
initialNumberOfValues: 10,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export type LocationFacetRequest = BaseCommerceFacetRequest<

export type BaseCommerceFacetRequest<Value, Type extends FacetType> = Pick<
FacetRequest,
'facetId' | 'field' | 'numberOfValues' | 'isFieldExpanded'
'facetId' | 'field' | 'isFieldExpanded'
> & {
displayName?: string;
type: Type;
Expand Down

0 comments on commit eb70faf

Please sign in to comment.