You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Readarr/frontend/src/Store/Reducers/Creators/createSetClientSideCollecti...

18 lines
615 B

import getSectionState from 'Utilities/State/getSectionState';
import updateSectionState from 'Utilities/State/updateSectionState';
import { filterTypes } from 'Helpers/Props';
function createSetClientSideCollectionFilterReducer(section) {
return (state, { payload }) => {
const newState = getSectionState(state, section);
newState.filterKey = payload.filterKey;
newState.filterValue = payload.filterValue;
newState.filterType = payload.filterType || filterTypes.EQUAL;
return updateSectionState(state, section, newState);
};
}
export default createSetClientSideCollectionFilterReducer;