mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-18 21:43:49 +00:00
Removed redundant function call
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user