Fixing incorrect services reference, and update default options param in the RequestHelper class

This commit is contained in:
Justin Dalrymple 2018-03-21 10:47:47 -04:00
parent 7b31faf171
commit e08ac4d44d
2 changed files with 5 additions and 5 deletions

View File

@ -94,4 +94,4 @@ export const ProjectNamespace = init({
});
// All initialized
export default init(Services);
export default init(APIServices);

View File

@ -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,