mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-13 19:13:46 +00:00
Moved all visits-related services to its own service provide function inside visits
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
import { curry } from 'ramda';
|
||||
import PropTypes from 'prop-types';
|
||||
import { buildShlinkApiClientWithAxios as buildShlinkApiClient } from '../../api/ShlinkApiClientBuilder';
|
||||
import { shortUrlType } from '../../short-urls/reducers/shortUrlsList';
|
||||
|
||||
/* eslint-disable padding-line-between-statements, newline-after-var */
|
||||
@@ -45,7 +43,7 @@ export default function reducer(state = initialState, action) {
|
||||
}
|
||||
}
|
||||
|
||||
export const _getShortUrlDetail = (buildShlinkApiClient, shortCode) => async (dispatch, getState) => {
|
||||
export const getShortUrlDetail = (buildShlinkApiClient) => (shortCode) => async (dispatch, getState) => {
|
||||
dispatch({ type: GET_SHORT_URL_DETAIL_START });
|
||||
|
||||
const { selectedServer } = getState();
|
||||
@@ -59,5 +57,3 @@ export const _getShortUrlDetail = (buildShlinkApiClient, shortCode) => async (di
|
||||
dispatch({ type: GET_SHORT_URL_DETAIL_ERROR });
|
||||
}
|
||||
};
|
||||
|
||||
export const getShortUrlDetail = curry(_getShortUrlDetail)(buildShlinkApiClient);
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import { curry } from 'ramda';
|
||||
import PropTypes from 'prop-types';
|
||||
import { buildShlinkApiClientWithAxios as buildShlinkApiClient } from '../../api/ShlinkApiClientBuilder';
|
||||
|
||||
/* eslint-disable padding-line-between-statements, newline-after-var */
|
||||
export const GET_SHORT_URL_VISITS_START = 'shlink/shortUrlVisits/GET_SHORT_URL_VISITS_START';
|
||||
@@ -44,7 +42,7 @@ export default function reducer(state = initialState, action) {
|
||||
}
|
||||
}
|
||||
|
||||
export const _getShortUrlVisits = (buildShlinkApiClient, shortCode, dates) => async (dispatch, getState) => {
|
||||
export const getShortUrlVisits = (buildShlinkApiClient) => (shortCode, dates) => async (dispatch, getState) => {
|
||||
dispatch({ type: GET_SHORT_URL_VISITS_START });
|
||||
|
||||
const { selectedServer } = getState();
|
||||
@@ -58,5 +56,3 @@ export const _getShortUrlVisits = (buildShlinkApiClient, shortCode, dates) => as
|
||||
dispatch({ type: GET_SHORT_URL_VISITS_ERROR });
|
||||
}
|
||||
};
|
||||
|
||||
export const getShortUrlVisits = curry(_getShortUrlVisits)(buildShlinkApiClient);
|
||||
|
||||
Reference in New Issue
Block a user