mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-24 20:14:35 -04:00
Can now select from available projects and snippets to build import URL.
This commit is contained in:
parent
de998c4a0f
commit
c16345ab12
4 changed files with 86 additions and 4 deletions
14
app.js
14
app.js
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue