mirror of
https://github.com/jdalrymple/gitbeaker.git
synced 2026-01-25 16:04:01 +00:00
Linting
This commit is contained in:
parent
1124682a9a
commit
7fc5f1238e
@ -3,7 +3,9 @@ import Request from 'request-promise';
|
||||
import XMLHttpRequester from './XMLHttpRequester';
|
||||
|
||||
class BaseModel {
|
||||
constructor({ url = 'https://gitlab.com', token, oauthToken, useXMLHttpRequest = false } = {}) {
|
||||
constructor({
|
||||
url = 'https://gitlab.com', token, oauthToken, useXMLHttpRequest = false
|
||||
} = {}) {
|
||||
this.url = URLJoin(url, 'api', 'v4');
|
||||
this.headers = {};
|
||||
this.requester = useXMLHttpRequest ? XMLHttpRequester : Request;
|
||||
|
||||
@ -7,13 +7,7 @@ import StreamableRequest from 'request';
|
||||
function defaultRequest(
|
||||
{ url, useXMLHttpRequest },
|
||||
endpoint,
|
||||
{
|
||||
headers,
|
||||
body,
|
||||
qs,
|
||||
formData,
|
||||
resolveWithFullResponse = false,
|
||||
},
|
||||
{ headers, body, qs, formData, resolveWithFullResponse = false },
|
||||
) {
|
||||
const params = {
|
||||
url: URLJoin(url, endpoint),
|
||||
@ -37,7 +31,9 @@ function defaultRequest(
|
||||
|
||||
function getStream(service, endpoint, options = {}) {
|
||||
if (service.useXMLHttpRequest) {
|
||||
throw new Error('Cannot use streaming functionality with XMLHttpRequest. Please instantiate without this option to use streaming');
|
||||
throw new Error(
|
||||
'Cannot use streaming functionality with XMLHttpRequest. Please instantiate without this option to use streaming',
|
||||
);
|
||||
}
|
||||
|
||||
const requestOptions = defaultRequest(service, endpoint, {
|
||||
|
||||
@ -1,6 +1,4 @@
|
||||
import {
|
||||
StatusCodeError,
|
||||
} from 'request-promise-core/errors';
|
||||
import { StatusCodeError } from 'request-promise-core/errors';
|
||||
import Promisify from 'util.promisify';
|
||||
import XHR from 'xhr';
|
||||
|
||||
@ -14,9 +12,7 @@ function promisifyFn(fn) {
|
||||
throw new StatusCodeError(response.statusCode, response.body, {}, null);
|
||||
}
|
||||
|
||||
return opts.resolveWithFullResponse
|
||||
? response
|
||||
: response.body;
|
||||
return opts.resolveWithFullResponse ? response : response.body;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -81,7 +81,7 @@ class Issues extends BaseService {
|
||||
|
||||
return RequestHelper.get(this, `projects/${pId}/issues/${mId}/time_stats`);
|
||||
}
|
||||
|
||||
|
||||
unsubscribe(projectId, issueId) {
|
||||
const [pId, iId] = [projectId, issueId].map(encodeURIComponent);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user