Fixed changing selected server

This commit is contained in:
Alejandro Celaya
2018-08-04 08:23:44 +02:00
parent daf67e1d43
commit 5517fcdde5
3 changed files with 23 additions and 8 deletions

View File

@@ -1,10 +1,18 @@
import { LIST_SHORT_URLS } from './shortUrlsList';
export default function reducer(state = { page: 1 }, action) {
const RESET_SHORT_URL_PARAMS = 'shlink/shortUrlsListParams/RESET_SHORT_URL_PARAMS';
const defaultState = { page: 1 };
export default function reducer(state = defaultState, action) {
switch (action.type) {
case LIST_SHORT_URLS:
return { ...state, ...action.params };
case RESET_SHORT_URL_PARAMS:
return defaultState;
default:
return state;
}
}
export const resetShortUrlParams = () => ({ type: RESET_SHORT_URL_PARAMS });