diff options
author | Jason Croft | 2016-05-12 11:19:14 -0400 |
---|---|---|
committer | Jason Croft | 2016-05-12 11:19:14 -0400 |
commit | c16345ab128288b92023e789f09cabb5197d1181 (patch) | |
tree | 61f160b25bfb1fbdf94b10df156368b53f807dc0 /app.js | |
parent | de998c4a0fcbadc4c0353c8e65d5769c271cfcd9 (diff) |
Can now select from available projects and snippets to build import URL.
Diffstat (limited to 'app.js')
-rw-r--r-- | app.js | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -448,10 +448,20 @@ app.get('/gitlab', function (req, res) { models.User.findById(req.cookies.userid) .then(function(user) { ret.accesstoken = user.accessToken; - return res.send(ret); + request( + config.gitlab.baseURL + '/api/v3/projects?access_token=' + user.accessToken, + function(error, httpResponse, body) { + if (!error && httpResponse.statusCode == 200) { + ret.projects = JSON.parse(body); + return res.send(ret); + } else { + return res.send(ret); + } + } + ); }).catch(function(err) { logger.error('user search failed: ' + err); - return done(err, null); + return response.errorInternalError(res); }); }); //get new note |