mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 17:19:37 +02:00
feat: fixing conversions in metrics (#31610)
GitOrigin-RevId: 76bae4b780c3b9a2c1de6c8d0bbf175634080804
This commit is contained in:
committed by
Copybot
parent
b131020c43
commit
af82f25944
@@ -292,7 +292,14 @@ function requireGraphAccess(req, res, next) {
|
||||
// call next router with fixed params to pass it to the correct middleware chain
|
||||
const { graph } = req.params
|
||||
const entityRoute = entityName === 'splitTest' ? 'split-test' : entityName
|
||||
req.url = `/graphs/${entityRoute}/${graph}/${req.query.resource_id}`
|
||||
|
||||
// all other routes go through analytics, which map undefined graph type to index (to fetch all graphs)
|
||||
// conversion still goes directly to v1, which can not handle an undefined graph param
|
||||
if (!graph?.length && entityRoute === 'conversion') {
|
||||
req.url = `/graphs/conversion/index/${req.query.resource_id}`
|
||||
} else {
|
||||
req.url = `/graphs/${entityRoute}/${graph}/${req.query.resource_id}`
|
||||
}
|
||||
next('route')
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user