Implemented first elements of short codes list

This commit is contained in:
Alejandro Celaya
2018-06-16 11:24:42 +02:00
parent f4c48bc94f
commit b008c37a5b
10 changed files with 134 additions and 24 deletions

View File

@@ -11,12 +11,12 @@ export default function shortUrlsListReducer(state = [], action) {
}
}
export const listShortUrls = (serverId) => {
export const listShortUrls = (serverId, params = {}) => {
return async dispatch => {
const selectedServer = ServersService.findServerById(serverId);
ShlinkApiClient.setConfig(selectedServer);
const shortUrls = await ShlinkApiClient.listShortUrls();
dispatch({ type: LIST_SHORT_URLS, shortUrls });
const shortUrls = await ShlinkApiClient.listShortUrls(params);
dispatch({ type: LIST_SHORT_URLS, shortUrls, selectedServer });
};
};