Skip to content

Commit

Permalink
fix: set query in facets module from selecting a query preview (#1318)
Browse files Browse the repository at this point in the history
  • Loading branch information
CachedaCodes authored Oct 10, 2023
1 parent 018d2c5 commit 5868a24
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/x-components/src/x-modules/facets/wiring.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ const clearStickyFilters = filter<XEventPayload<'SearchResponseChanged'>>(
);

/**
* Sets the filters of the facets module from a selectedQueryPreview's filters.
* Sets the filters of the facets module from a queryPreview's filters.
*
* @public
*/
Expand All @@ -166,6 +166,13 @@ export const setSelectedFiltersFromPreview = wireCommit(
({ eventPayload: { filters } }) => (filters ? createRawFilters(filters) : [])
);

/**
* Sets the query of the facets module from a queryPreview.
*
* @public
*/
export const setQueryFromPreview = wireCommit('setQuery', ({ eventPayload: { query } }) => query);

/**
* Wiring configuration for the {@link FacetsXModule | facets module}.
*
Expand Down Expand Up @@ -218,6 +225,7 @@ export const facetsWiring = createWiring({
clearStickyFilters
},
UserAcceptedAQueryPreview: {
setQueryFromPreview,
setSelectedFiltersFromPreview
}
});

0 comments on commit 5868a24

Please sign in to comment.