diff --git a/src/adapters/authAdapter.ts b/src/adapters/authAdapter.ts index 5e8eee4..cee734a 100644 --- a/src/adapters/authAdapter.ts +++ b/src/adapters/authAdapter.ts @@ -16,7 +16,7 @@ class AuthAdapter extends BaseAdapter { }; /* eslint-enable camelcase */ - return this.prototype.postRequest(`${process.env.REACT_APP_API_ENDPOINT}/oauth/token`, { data: requestParams }); + return this.prototype.postRequest('oauth/token', { data: requestParams }); } } diff --git a/src/adapters/baseAdapter..ts b/src/adapters/baseAdapter..ts index e516e3a..530dd38 100644 --- a/src/adapters/baseAdapter..ts +++ b/src/adapters/baseAdapter..ts @@ -1,12 +1,14 @@ import requestManager, { RequestParamsType } from 'lib/requestManager'; class BaseAdapter { + static baseUrl = process.env.REACT_APP_API_ENDPOINT; + getRequest(endpoint: string, params: RequestParamsType) { - return requestManager('GET', endpoint, params); + return requestManager('GET', `${BaseAdapter.baseUrl}/${endpoint}`, params); } postRequest(endpoint: string, params: RequestParamsType) { - return requestManager('POST', endpoint, params); + return requestManager('POST', `${BaseAdapter.baseUrl}/${endpoint}`, params); } }