From e223b2d206ba9dfde63499a25b2310158561919a Mon Sep 17 00:00:00 2001 From: acondal Date: Wed, 11 Oct 2023 11:09:36 +0200 Subject: [PATCH] feat!: use config utils (search) BREAKING CHANGE: setPageSize mutation has been renamed/replaced by setConfig EMP-2328 --- packages/x-components/src/x-modules/search/store/module.ts | 5 ++--- packages/x-components/src/x-modules/search/store/types.ts | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/x-components/src/x-modules/search/store/module.ts b/packages/x-components/src/x-modules/search/store/module.ts index 864ff08f98..49dc4519b1 100644 --- a/packages/x-components/src/x-modules/search/store/module.ts +++ b/packages/x-components/src/x-modules/search/store/module.ts @@ -2,6 +2,7 @@ import { isFacetFilter } from '@empathyco/x-types'; import { setQuery } from '../../../store/utils/query.utils'; import { setStatus } from '../../../store/utils/status-store.utils'; import { groupItemsBy } from '../../../utils/array'; +import { setConfig } from '../../../store/utils/config-store.utils'; // eslint-disable-next-line max-len import { cancelFetchAndSaveSearchResponse, @@ -81,9 +82,7 @@ export const searchXStoreModule: SearchXStoreModule = { setPage(state, page) { state.page = page; }, - setPageSize(state, pageSize) { - state.config.pageSize = pageSize; - }, + setConfig, setIsAppendResults(state, isAppendResults) { state.isAppendResults = isAppendResults; }, diff --git a/packages/x-components/src/x-modules/search/store/types.ts b/packages/x-components/src/x-modules/search/store/types.ts index f651ce4820..edc9074ab4 100644 --- a/packages/x-components/src/x-modules/search/store/types.ts +++ b/packages/x-components/src/x-modules/search/store/types.ts @@ -147,11 +147,11 @@ export interface SearchMutations extends StatusMutations, QueryMutations { */ setPage(page: number): void; /** - * Sets the page size of the module. + * Sets the {@link SearchState.config } config. * - * @param pageSize - The new page size. + * @param config - The new config. */ - setPageSize(pageSize: number): void; + setConfig(config: SearchConfig): void; /** * Sets the extra params of the module. *