mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
review fixes and moving licences endpoint to module
This commit is contained in:
parent
8d72fc78fc
commit
bd721d52f4
3 changed files with 2 additions and 5 deletions
|
@ -25,11 +25,10 @@ module.exports = AnalyticsController =
|
||||||
respondWith(error, res, next)
|
respondWith(error, res, next)
|
||||||
|
|
||||||
licences: (req, res, next) ->
|
licences: (req, res, next) ->
|
||||||
AuthenticationController.getLoggedInUserId(req) or req.sessionID
|
|
||||||
{resource_id, start_date, end_date, lag} = req.query
|
{resource_id, start_date, end_date, lag} = req.query
|
||||||
InstitutionsAPI.getInstitutionLicences resource_id, start_date, end_date, lag, (error, licences) ->
|
InstitutionsAPI.getInstitutionLicences resource_id, start_date, end_date, lag, (error, licences) ->
|
||||||
if error?
|
if error?
|
||||||
res.send 503
|
next(error)
|
||||||
else
|
else
|
||||||
res.send licences
|
res.send licences
|
||||||
|
|
||||||
|
|
|
@ -9,8 +9,6 @@ module.exports =
|
||||||
webRouter.put '/editingSession/:projectId',
|
webRouter.put '/editingSession/:projectId',
|
||||||
AnalyticsController.updateEditingSession
|
AnalyticsController.updateEditingSession
|
||||||
|
|
||||||
webRouter.get '/graphs/licences', AnalyticsController.licences
|
|
||||||
|
|
||||||
publicApiRouter.use '/analytics/graphs',
|
publicApiRouter.use '/analytics/graphs',
|
||||||
AuthenticationController.httpAuth,
|
AuthenticationController.httpAuth,
|
||||||
AnalyticsProxy.call('/graphs')
|
AnalyticsProxy.call('/graphs')
|
||||||
|
|
|
@ -16,7 +16,7 @@ module.exports = InstitutionsAPI =
|
||||||
method: 'GET'
|
method: 'GET'
|
||||||
path: "/api/v2/institutions/#{institutionId.toString()}/institution_licences"
|
path: "/api/v2/institutions/#{institutionId.toString()}/institution_licences"
|
||||||
body: {start_date: startDate, end_date: endDate, lag}
|
body: {start_date: startDate, end_date: endDate, lag}
|
||||||
defaultErrorMessage: "Couldn't get institution affiliations"
|
defaultErrorMessage: "Couldn't get institution licences"
|
||||||
}, callback
|
}, callback
|
||||||
|
|
||||||
getUserAffiliations: (userId, callback = (error, body) ->) ->
|
getUserAffiliations: (userId, callback = (error, body) ->) ->
|
||||||
|
|
Loading…
Reference in a new issue