Added tests for new logics

This commit is contained in:
Alejandro Celaya
2019-10-05 10:40:32 +02:00
parent 4120d09220
commit 6d996baf5d
4 changed files with 72 additions and 2 deletions

View File

@@ -2,12 +2,13 @@ import qs from 'qs';
import { isEmpty, isNil, reject } from 'ramda';
const API_VERSION = '1';
const buildRestUrl = (url) => url ? `${url}/rest/v${API_VERSION}` : '';
export const buildShlinkBaseUrl = (url) => url ? `${url}/rest/v${API_VERSION}` : '';
export default class ShlinkApiClient {
constructor(axios, baseUrl, apiKey) {
this.axios = axios;
this._baseUrl = buildRestUrl(baseUrl);
this._baseUrl = buildShlinkBaseUrl(baseUrl);
this._apiKey = apiKey || '';
}