rename all db columns

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-04-08 21:25:32 +02:00
parent 95b93b5f3a
commit 097ea18320
30 changed files with 303 additions and 232 deletions

View File

@@ -45,11 +45,11 @@ export function transformReport(
): IChartInput & { id: string } {
return {
id: report.id,
projectId: report.project_id,
projectId: report.projectId,
events: (report.events as IChartEvent[]).map(transformReportEvent),
breakdowns: report.breakdowns as IChartBreakdown[],
chartType: report.chart_type,
lineType: (report.line_type as IChartLineType) ?? lineTypes.monotone,
chartType: report.chartType,
lineType: (report.lineType as IChartLineType) ?? lineTypes.monotone,
interval: report.interval,
name: report.name || 'Untitled',
range: (report.range as IChartRange) ?? timeRanges['1m'],
@@ -64,7 +64,7 @@ export function getReportsByDashboardId(dashboardId: string) {
return db.report
.findMany({
where: {
dashboard_id: dashboardId,
dashboardId,
},
})
.then((reports) => reports.map(transformReport));