Merge pull request #2196 from overleaf/jel-template-metrics

Set templateId for template graph requests

GitOrigin-RevId: 65167a30ab427146582389ea44d3d1eb9ccecacf
This commit is contained in:
Jessica Lawshe 2019-10-02 09:06:13 -05:00 committed by sharelatex
parent c1f43ad60e
commit 398d355ffd

View file

@ -175,6 +175,9 @@ let UserMembershipMiddleware = {
new HttpErrors.NotFoundError(`incorrect entity name: ${entityName}`) new HttpErrors.NotFoundError(`incorrect entity name: ${entityName}`)
) )
} }
if (entityName === 'Template') {
req.params.templateId = req.params.id
}
// run the list of middleware functions in series. This is essencially // run the list of middleware functions in series. This is essencially
// a poor man's middleware runner // a poor man's middleware runner
async.eachSeries(middleware, (fn, callback) => fn(req, res, callback), next) async.eachSeries(middleware, (fn, callback) => fn(req, res, callback), next)