Skip to content

Commit

Permalink
Update to use legacy report endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
alexd-bes committed Jul 11, 2023
1 parent c8cbd2e commit a5c86f8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/tupaia-web/src/api/queries/useReport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ export const useReport = (reportCode: DashboardItemType['reportCode'], params: Q
const timeZone = getBrowserTimeZone();
const formattedStartDate = formatDateForApi(startDate, null);
const formattedEndDate = formatDateForApi(endDate, null);
const endpoint = legacy ? 'legacyDashboardReport' : 'report';
return useQuery(
[
'report',
endpoint,
reportCode,
dashboardCode,
projectCode,
Expand All @@ -36,10 +37,9 @@ export const useReport = (reportCode: DashboardItemType['reportCode'], params: Q
formattedEndDate,
],
() =>
get(`report/${reportCode}`, {
get(`${endpoint}/${reportCode}`, {
params: {
dashboardCode,
legacy,
itemCode,
projectCode,
organisationUnitCode: entityCode,
Expand Down

0 comments on commit a5c86f8

Please sign in to comment.