diff --git a/src/infrastructure/BaseService.js b/src/infrastructure/BaseService.js index 610f9af9..96b18873 100644 --- a/src/infrastructure/BaseService.js +++ b/src/infrastructure/BaseService.js @@ -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; diff --git a/src/infrastructure/RequestHelper.js b/src/infrastructure/RequestHelper.js index e4c5d236..459ecfc6 100644 --- a/src/infrastructure/RequestHelper.js +++ b/src/infrastructure/RequestHelper.js @@ -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, { diff --git a/src/infrastructure/XMLHttpRequester.js b/src/infrastructure/XMLHttpRequester.js index 45f37d6f..dd85d5c7 100644 --- a/src/infrastructure/XMLHttpRequester.js +++ b/src/infrastructure/XMLHttpRequester.js @@ -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; }; } diff --git a/src/services/Issues.js b/src/services/Issues.js index 67ae688b..4fbc93ad 100644 --- a/src/services/Issues.js +++ b/src/services/Issues.js @@ -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);