mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-08-01 00:21:52 +00:00
Added ordering capabilities to short URLs list
This commit is contained in:
@@ -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 });
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user