mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #2079 from overleaf/ta-institution-new-licences
Add Routing for New Licences Metrics Graph GitOrigin-RevId: 9e7def383d257db1eef03b1224b4b5fef376427c
This commit is contained in:
parent
4d69b63993
commit
0e8866f651
2 changed files with 30 additions and 0 deletions
|
@ -48,6 +48,21 @@ module.exports = {
|
|||
res.send(licences)
|
||||
}
|
||||
)
|
||||
},
|
||||
|
||||
newLicences(req, res, next) {
|
||||
InstitutionsAPI.getInstitutionNewLicences(
|
||||
req.query.resource_id,
|
||||
req.query.start_date,
|
||||
req.query.end_date,
|
||||
req.query.lag,
|
||||
function(error, licences) {
|
||||
if (error) {
|
||||
return next(error)
|
||||
}
|
||||
res.send(licences)
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -48,6 +48,21 @@ module.exports = InstitutionsAPI = {
|
|||
)
|
||||
},
|
||||
|
||||
getInstitutionNewLicences(institutionId, startDate, endDate, lag, callback) {
|
||||
if (callback == null) {
|
||||
callback = function(error, body) {}
|
||||
}
|
||||
return makeAffiliationRequest(
|
||||
{
|
||||
method: 'GET',
|
||||
path: `/api/v2/institutions/${institutionId.toString()}/new_institution_licences`,
|
||||
body: { start_date: startDate, end_date: endDate, lag },
|
||||
defaultErrorMessage: "Couldn't get institution new licences"
|
||||
},
|
||||
callback
|
||||
)
|
||||
},
|
||||
|
||||
getUserAffiliations(userId, callback) {
|
||||
if (callback == null) {
|
||||
callback = function(error, body) {}
|
||||
|
|
Loading…
Reference in a new issue