mirror of https://github.com/status-im/codimd.git
refactor: fix lint warning on lib/response.js
Signed-off-by: BoHong Li <a60814billy@gmail.com>
This commit is contained in:
parent
b0dee3ee14
commit
0883595e95
|
@ -18,7 +18,7 @@ var utils = require('./utils')
|
|||
// public
|
||||
var response = {
|
||||
errorForbidden: function (res) {
|
||||
const {req} = res
|
||||
const { req } = res
|
||||
if (req.user) {
|
||||
responseError(res, '403', 'Forbidden', 'oh no.')
|
||||
} else {
|
||||
|
@ -549,16 +549,16 @@ function gitlabActionProjects (req, res, note) {
|
|||
ret.accesstoken = user.accessToken
|
||||
ret.profileid = user.profileid
|
||||
request(
|
||||
config.gitlab.baseURL + '/api/' + config.gitlab.version + '/projects?membership=yes&per_page=100&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)
|
||||
}
|
||||
}
|
||||
)
|
||||
config.gitlab.baseURL + '/api/' + config.gitlab.version + '/projects?membership=yes&per_page=100&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('gitlab action projects failed: ' + err)
|
||||
return response.errorInternalError(res)
|
||||
|
|
Loading…
Reference in New Issue