Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixup silly errors #4721

Merged
merged 2 commits into from
Jul 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/tupaia-web-server/src/app/createApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export function createApp() {
'requestCountryAccess',
handleWith(RequestCountryAccessRoute),
)
.get<EntitiesRequest>('entities/:hierarchyName/:rootEntityCode', handleWith(EntitiesRoute))
.get<EntitiesRequest>('entities/:projectCode/:rootEntityCode', handleWith(EntitiesRoute))
.get<EntitySearchRequest>('entitySearch/:projectCode', handleWith(EntitySearchRoute))
.get<EntitiesRequest>('entities/:projectCode/:rootEntityCode', handleWith(EntitiesRoute))
.get<EntityAncestorsRequest>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<LegacyDashboardReportRequest> {
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 });
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ export class LegacyMapOverlayReportRoute extends Route<LegacyMapOverlayReportReq
const { query, ctx } = this.req;
const { mapOverlayCode } = this.req.params;

return ctx.services.webConfig.fetchMeasureData(mapOverlayCode, query);
return ctx.services.webConfig.fetchMeasureData(mapOverlayCode, { legacy: true, ...query });
}
}
2 changes: 1 addition & 1 deletion packages/tupaia-web-server/src/routes/ReportRoute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class ReportRoute extends Route<ReportRequest> {
// the params for the non-legacy reports are different
const params = {
organisationUnitCodes: organisationUnitCode,
hierarchyName: projectCode,
hierarchy: projectCode,
startDate,
endDate,
};
Expand Down