Added ordering capabilities to short URLs list

This commit is contained in:
Alejandro Celaya
2018-07-22 09:37:57 +02:00
parent 6e6e54fa36
commit 86a1cdf4d1
7 changed files with 93 additions and 22 deletions

View File

@@ -32,7 +32,7 @@ export const listShortUrls = (serverId, params = {}) => {
ShlinkApiClient.setConfig(selectedServer);
const shortUrls = await ShlinkApiClient.listShortUrls(params);
dispatch({ type: LIST_SHORT_URLS, shortUrls, selectedServer });
dispatch({ type: LIST_SHORT_URLS, shortUrls, selectedServer, params });
};
};

View File

@@ -1,8 +1,9 @@
import { UPDATE_SHORT_URLS_LIST } from './shortUrlsList';
import { UPDATE_SHORT_URLS_LIST, LIST_SHORT_URLS } from './shortUrlsList';
export default function reducer(state = { page: 1 }, action) {
switch (action.type) {
case UPDATE_SHORT_URLS_LIST:
case LIST_SHORT_URLS:
return { ...state, ...action.params };
default:
return state;