Skip to content
Snippets Groups Projects
Unverified Commit 982f555a authored by Neil's avatar Neil Committed by GitHub
Browse files

Custom Reports: updateReport db Schema fix (#3127)

* updateReport db Schema fix

* notes

* error
parent fe70ecb6
No related branches found
No related tags found
No related merge requests found
...@@ -46,7 +46,6 @@ const reportModel = { ...@@ -46,7 +46,6 @@ const reportModel = {
graphType: row.graph_type, graphType: row.graph_type,
conditions: row.conditions, conditions: row.conditions,
conditionsOp: row.conditions_op, conditionsOp: row.conditions_op,
data: row.metadata,
}; };
}, },
...@@ -71,7 +70,6 @@ const reportModel = { ...@@ -71,7 +70,6 @@ const reportModel = {
graph_type: report.graphType, graph_type: report.graphType,
conditions: report.conditions, conditions: report.conditions,
conditions_op: report.conditionsOp, conditions_op: report.conditionsOp,
metadata: report.data,
}; };
}, },
}; };
...@@ -141,7 +139,7 @@ async function updateReport(item: CustomReportEntity) { ...@@ -141,7 +139,7 @@ async function updateReport(item: CustomReportEntity) {
throw new Error('There is already a filter named ' + item.name); 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) { async function deleteReport(id: string) {
......
---
category: Bugfix
authors: [carkom]
---
Fix issue with schema in updateReports function that was using insert instead of update
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment