mirror of
https://github.com/jdalrymple/gitbeaker.git
synced 2026-01-25 16:04:01 +00:00
Fixing incorrect services reference, and update default options param in the RequestHelper class
This commit is contained in:
parent
7b31faf171
commit
e08ac4d44d
@ -94,4 +94,4 @@ export const ProjectNamespace = init({
|
||||
});
|
||||
|
||||
// All initialized
|
||||
export default init(Services);
|
||||
export default init(APIServices);
|
||||
|
||||
@ -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,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user