Removed redundant function call

This commit is contained in:
Alejandro Celaya 2020-02-08 10:02:33 +01:00
parent 58077f2d86
commit c67ce3918b

View file

@ -1,5 +1,5 @@
import qs from 'qs'; import qs from 'qs';
import { isEmpty, isNil, pipe, reject } from 'ramda'; import { isEmpty, isNil, reject } from 'ramda';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
export const apiErrorType = PropTypes.shape({ export const apiErrorType = PropTypes.shape({
@ -12,7 +12,7 @@ export const apiErrorType = PropTypes.shape({
}); });
const buildShlinkBaseUrl = (url, apiVersion) => url ? `${url}/rest/v${apiVersion}` : ''; const buildShlinkBaseUrl = (url, apiVersion) => url ? `${url}/rest/v${apiVersion}` : '';
const rejectNilProps = (options = {}) => reject(isNil, options); const rejectNilProps = reject(isNil);
export default class ShlinkApiClient { export default class ShlinkApiClient {
constructor(axios, baseUrl, apiKey) { constructor(axios, baseUrl, apiKey) {
@ -22,10 +22,8 @@ export default class ShlinkApiClient {
this._apiKey = apiKey || ''; this._apiKey = apiKey || '';
} }
listShortUrls = pipe( listShortUrls = (options = {}) =>
rejectNilProps, this._performRequest('/short-urls', 'GET', options).then((resp) => resp.data.shortUrls);
(options) => this._performRequest('/short-urls', 'GET', options).then((resp) => resp.data.shortUrls)
);
createShortUrl = (options) => { createShortUrl = (options) => {
const filteredOptions = reject((value) => isEmpty(value) || isNil(value), options); const filteredOptions = reject((value) => isEmpty(value) || isNil(value), options);