Skip to content

Commit

Permalink
feat!: use config utils (search)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: setPageSize mutation has been renamed/replaced by setConfig

EMP-2328
  • Loading branch information
annacv committed Oct 11, 2023
1 parent a71eeb9 commit e223b2d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 2 additions & 3 deletions packages/x-components/src/x-modules/search/store/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;
},
Expand Down
6 changes: 3 additions & 3 deletions packages/x-components/src/x-modules/search/store/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down

0 comments on commit e223b2d

Please sign in to comment.