Skip to content

A local-first personal finance app

Custom Reports: updateReport db Schema fix (#3127)

Neil982f555a21ef
diff --git a/packages/loot-core/src/server/reports/app.ts b/packages/loot-core/src/server/reports/app.ts
index e295f6f786..42eb091421 100644
--- a/packages/loot-core/src/server/reports/app.ts
+++ b/packages/loot-core/src/server/reports/app.ts
@@ -46,7 +46,6 @@ const reportModel = {
graphType: row.graph_type,
conditions: row.conditions,
conditionsOp: row.conditions_op,
- data: row.metadata,
};
},
@@ -71,7 +70,6 @@ const reportModel = {
graph_type: report.graphType,
conditions: report.conditions,
conditions_op: report.conditionsOp,
- metadata: report.data,
};
},
};
@@ -141,7 +139,7 @@ async function updateReport(item: CustomReportEntity) {
throw new Error('There is already a filter named ' + item.name);
}
- await db.insertWithSchema('custom_reports', reportModel.fromJS(item));
+ await db.updateWithSchema('custom_reports', reportModel.fromJS(item));
}
async function deleteReport(id: string) {
diff --git a/upcoming-release-notes/3127.md b/upcoming-release-notes/3127.md
new file mode 100644
index 0000000000..579f5e5b43
--- /dev/null
+++ b/upcoming-release-notes/3127.md
@@ -0,0 +1,6 @@
+---
+category: Bugfix
+authors: [carkom]
+---
+
+Fix issue with schema in updateReports function that was using insert instead of update