Skip to content

Commit

Permalink
hotfix: Fix whole dashboard export email (#5384)
Browse files Browse the repository at this point in the history
  • Loading branch information
rohan-bes authored Jan 29, 2024
1 parent 413cfa8 commit 0e0eb63
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions packages/tupaia-web-server/src/routes/EmailDashboardRoute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,12 @@ export class EmailDashboardRoute extends Route<EmailDashboardRequest> {
},
columns: ['id'],
})) as Pick<Project, 'id'>[];
const [projectEntity] = (await this.req.ctx.services.central.fetchResources('entities', {
filter: {
code: projectCode,
},
columns: ['name'],
})) as Pick<Entity, 'name'>[];
const [entity] = (await this.req.ctx.services.central.fetchResources('entities', {
filter: {
code: entityCode,
},
columns: ['id', 'name', 'country_code'],
})) as Pick<Entity, 'id' | 'name' | 'country_code'>[];
const projectEntity = (await this.req.ctx.services.entity.getEntity(projectCode, projectCode, {
fields: ['name'],
})) as Pick<Entity, 'name'>;
const entity = (await this.req.ctx.services.entity.getEntity(projectCode, entityCode, {
fields: ['id', 'name', 'country_code'],
})) as Pick<Entity, 'id' | 'name' | 'country_code'>;
const [dashboard] = (await this.req.ctx.services.central.fetchResources('dashboards', {
filter: { code: dashboardCode },
columns: ['id', 'name'],
Expand Down

0 comments on commit 0e0eb63

Please sign in to comment.