summaryrefslogtreecommitdiff
path: root/lib/response.js
diff options
context:
space:
mode:
authorCédric Couralet2018-07-30 13:47:09 +0000
committerCédric Couralet2018-07-31 08:36:56 +0000
commit66d374b1289e6dd33008dc931e9fb642051724d0 (patch)
tree4801a08657d2a0fd04c03a3ed46440e221f0ae23 /lib/response.js
parent93a3ce1164f69af24381c94b941048580891e1b8 (diff)
Add possibility to choose between version v3 or v4 for the gitlab api.
Apart from the uri versioning, one big change is the snippet visibility post data (visibility_level -> visibility) Default gitlab api version to v4 Signed-off-by: Cédric Couralet <cedric.couralet@gmail.com>
Diffstat (limited to 'lib/response.js')
-rw-r--r--lib/response.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/response.js b/lib/response.js
index 3a31c511..37211998 100644
--- a/lib/response.js
+++ b/lib/response.js
@@ -573,11 +573,11 @@ function gitlabActionProjects (req, res, note) {
}
}).then(function (user) {
if (!user) { return response.errorNotFound(res) }
- var ret = { baseURL: config.gitlab.baseURL }
+ var ret = { baseURL: config.gitlab.baseURL, version: config.gitlab.version }
ret.accesstoken = user.accessToken
ret.profileid = user.profileid
request(
- config.gitlab.baseURL + '/api/v3/projects?access_token=' + user.accessToken,
+ config.gitlab.baseURL + '/api/' + config.gitlab.version + '/projects?access_token=' + user.accessToken,
function (error, httpResponse, body) {
if (!error && httpResponse.statusCode === 200) {
ret.projects = JSON.parse(body)