diff --git a/src/index.js b/src/index.js index 40b91b62..a9806700 100644 --- a/src/index.js +++ b/src/index.js @@ -94,4 +94,4 @@ export const ProjectNamespace = init({ }); // All initialized -export default init(Services); +export default init(APIServices); diff --git a/src/infrastructure/RequestHelper.js b/src/infrastructure/RequestHelper.js index 05ffd843..ba7ce2c6 100644 --- a/src/infrastructure/RequestHelper.js +++ b/src/infrastructure/RequestHelper.js @@ -24,7 +24,7 @@ function defaultRequest( } class RequestHelper { - static async get(service, endpoint, options, fullResponse = false) { + static async get(service, endpoint, options = {}, fullResponse = false) { const response = await Request.get(defaultRequest(service.url, endpoint, { headers: service.headers, qs: options, @@ -43,7 +43,7 @@ class RequestHelper { return [...response.body, ...more]; } - static post(service, endpoint, options, form = false) { + static post(service, endpoint, options = {}, form = false) { const body = form ? 'fromData' : 'body'; return Request.post(defaultRequest(service.url, endpoint, { @@ -52,14 +52,14 @@ class RequestHelper { })); } - static put(service, endpoint, options) { + static put(service, endpoint, options = {}) { return Request.put(defaultRequest(service.url, endpoint, { headers: service.headers, body: options, })); } - static delete(service, endpoint, options) { + static delete(service, endpoint, options = {}) { return Request.delete(defaultRequest(service.url, endpoint, { headers: service.headers, qs: options,