mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-11 10:03:51 +00:00
Moved all server-related services to its own service provider
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import { assoc, assocPath, reject } from 'ramda';
|
||||
import PropTypes from 'prop-types';
|
||||
import { buildShlinkApiClientWithAxios as buildShlinkApiClient } from '../../api/ShlinkApiClientBuilder';
|
||||
import { SHORT_URL_TAGS_EDITED } from './shortUrlTags';
|
||||
import { SHORT_URL_DELETED } from './shortUrlDeletion';
|
||||
|
||||
@@ -55,10 +54,10 @@ export default function reducer(state = initialState, action) {
|
||||
}
|
||||
}
|
||||
|
||||
export const _listShortUrls = (buildShlinkApiClient, params = {}) => async (dispatch, getState) => {
|
||||
export const listShortUrls = (buildShlinkApiClient) => (params = {}) => async (dispatch, getState) => {
|
||||
dispatch({ type: LIST_SHORT_URLS_START });
|
||||
|
||||
const { selectedServer } = getState();
|
||||
const { selectedServer = {} } = getState();
|
||||
const shlinkApiClient = buildShlinkApiClient(selectedServer);
|
||||
|
||||
try {
|
||||
@@ -69,5 +68,3 @@ export const _listShortUrls = (buildShlinkApiClient, params = {}) => async (disp
|
||||
dispatch({ type: LIST_SHORT_URLS_ERROR, params });
|
||||
}
|
||||
};
|
||||
|
||||
export const listShortUrls = (params = {}) => _listShortUrls(buildShlinkApiClient, params);
|
||||
|
||||
Reference in New Issue
Block a user