mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 06:03:45 +01:00
review fixes and moving licences endpoint to module
This commit is contained in:
@@ -25,11 +25,10 @@ module.exports = AnalyticsController =
|
||||
respondWith(error, res, next)
|
||||
|
||||
licences: (req, res, next) ->
|
||||
AuthenticationController.getLoggedInUserId(req) or req.sessionID
|
||||
{resource_id, start_date, end_date, lag} = req.query
|
||||
InstitutionsAPI.getInstitutionLicences resource_id, start_date, end_date, lag, (error, licences) ->
|
||||
if error?
|
||||
res.send 503
|
||||
next(error)
|
||||
else
|
||||
res.send licences
|
||||
|
||||
|
||||
@@ -9,8 +9,6 @@ module.exports =
|
||||
webRouter.put '/editingSession/:projectId',
|
||||
AnalyticsController.updateEditingSession
|
||||
|
||||
webRouter.get '/graphs/licences', AnalyticsController.licences
|
||||
|
||||
publicApiRouter.use '/analytics/graphs',
|
||||
AuthenticationController.httpAuth,
|
||||
AnalyticsProxy.call('/graphs')
|
||||
|
||||
@@ -16,7 +16,7 @@ module.exports = InstitutionsAPI =
|
||||
method: 'GET'
|
||||
path: "/api/v2/institutions/#{institutionId.toString()}/institution_licences"
|
||||
body: {start_date: startDate, end_date: endDate, lag}
|
||||
defaultErrorMessage: "Couldn't get institution affiliations"
|
||||
defaultErrorMessage: "Couldn't get institution licences"
|
||||
}, callback
|
||||
|
||||
getUserAffiliations: (userId, callback = (error, body) ->) ->
|
||||
|
||||
Reference in New Issue
Block a user