feat: fixing conversions in metrics (#31610)

GitOrigin-RevId: 76bae4b780c3b9a2c1de6c8d0bbf175634080804
This commit is contained in:
Jimmy Domagala-Tang
2026-02-25 09:57:27 -05:00
committed by Copybot
parent b131020c43
commit af82f25944

View File

@@ -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')
}