mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2024-12-23 09:30:31 +03:00
Removed redundant function call
This commit is contained in:
parent
58077f2d86
commit
c67ce3918b
1 changed files with 4 additions and 6 deletions
|
@ -1,5 +1,5 @@
|
|||
import qs from 'qs';
|
||||
import { isEmpty, isNil, pipe, reject } from 'ramda';
|
||||
import { isEmpty, isNil, reject } from 'ramda';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
export const apiErrorType = PropTypes.shape({
|
||||
|
@ -12,7 +12,7 @@ export const apiErrorType = PropTypes.shape({
|
|||
});
|
||||
|
||||
const buildShlinkBaseUrl = (url, apiVersion) => url ? `${url}/rest/v${apiVersion}` : '';
|
||||
const rejectNilProps = (options = {}) => reject(isNil, options);
|
||||
const rejectNilProps = reject(isNil);
|
||||
|
||||
export default class ShlinkApiClient {
|
||||
constructor(axios, baseUrl, apiKey) {
|
||||
|
@ -22,10 +22,8 @@ export default class ShlinkApiClient {
|
|||
this._apiKey = apiKey || '';
|
||||
}
|
||||
|
||||
listShortUrls = pipe(
|
||||
rejectNilProps,
|
||||
(options) => this._performRequest('/short-urls', 'GET', options).then((resp) => resp.data.shortUrls)
|
||||
);
|
||||
listShortUrls = (options = {}) =>
|
||||
this._performRequest('/short-urls', 'GET', options).then((resp) => resp.data.shortUrls);
|
||||
|
||||
createShortUrl = (options) => {
|
||||
const filteredOptions = reject((value) => isEmpty(value) || isNil(value), options);
|
||||
|
|
Loading…
Reference in a new issue