diff --git a/packages/x-components/src/x-modules/facets/wiring.ts b/packages/x-components/src/x-modules/facets/wiring.ts index 1c1699db52..297618d7b7 100644 --- a/packages/x-components/src/x-modules/facets/wiring.ts +++ b/packages/x-components/src/x-modules/facets/wiring.ts @@ -157,7 +157,7 @@ const clearStickyFilters = filter>( ); /** - * 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 */ @@ -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}. * @@ -218,6 +225,7 @@ export const facetsWiring = createWiring({ clearStickyFilters }, UserAcceptedAQueryPreview: { + setQueryFromPreview, setSelectedFiltersFromPreview } });