diff --git a/packages/tupaia-web-server/src/app/createApp.ts b/packages/tupaia-web-server/src/app/createApp.ts index c07383ba74..1b1394fc59 100644 --- a/packages/tupaia-web-server/src/app/createApp.ts +++ b/packages/tupaia-web-server/src/app/createApp.ts @@ -69,7 +69,7 @@ export function createApp() { 'requestCountryAccess', handleWith(RequestCountryAccessRoute), ) - .get('entities/:hierarchyName/:rootEntityCode', handleWith(EntitiesRoute)) + .get('entities/:projectCode/:rootEntityCode', handleWith(EntitiesRoute)) .get('entitySearch/:projectCode', handleWith(EntitySearchRoute)) .get('entities/:projectCode/:rootEntityCode', handleWith(EntitiesRoute)) .get( diff --git a/packages/tupaia-web-server/src/routes/LegacyDashboardReportRoute.ts b/packages/tupaia-web-server/src/routes/LegacyDashboardReportRoute.ts index ce3a87cc02..3543429217 100644 --- a/packages/tupaia-web-server/src/routes/LegacyDashboardReportRoute.ts +++ b/packages/tupaia-web-server/src/routes/LegacyDashboardReportRoute.ts @@ -7,18 +7,13 @@ import { Request } from 'express'; import { Route } from '@tupaia/server-boilerplate'; -export type LegacyDashboardReportRequest = Request< - { reportCode: string }, - any, - any, - any ->; +export type LegacyDashboardReportRequest = Request<{ reportCode: string }, any, any, any>; export class LegacyDashboardReportRoute extends Route { public async buildResponse() { const { query, ctx } = this.req; const { reportCode } = this.req.params; - return ctx.services.webConfig.fetchReport(reportCode, query); + return ctx.services.webConfig.fetchReport(reportCode, { legacy: true, ...query }); } } diff --git a/packages/tupaia-web-server/src/routes/LegacyMapOverlayReportRoute.ts b/packages/tupaia-web-server/src/routes/LegacyMapOverlayReportRoute.ts index 2dcf3fd529..7ca4da16d3 100644 --- a/packages/tupaia-web-server/src/routes/LegacyMapOverlayReportRoute.ts +++ b/packages/tupaia-web-server/src/routes/LegacyMapOverlayReportRoute.ts @@ -13,6 +13,6 @@ export class LegacyMapOverlayReportRoute extends Route { // the params for the non-legacy reports are different const params = { organisationUnitCodes: organisationUnitCode, - hierarchyName: projectCode, + hierarchy: projectCode, startDate, endDate, };