Skip to content

Commit

Permalink
If no reportFilters provided on updateReports, default to original
Browse files Browse the repository at this point in the history
  • Loading branch information
heythisischris committed Jul 18, 2024
1 parent 9d519a7 commit 5792c58
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/routes/updateReports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const updateReports = async ({ request, reply }) => {
`, [request.body.reportId, jwtClaims.sub]))?.rows?.[0];
await db.query(`
UPDATE "reports" SET "name"=$1, "filters"=$2 WHERE "id"=$3 AND "user_id"=$4
`, [request.body.reportName ?? original.name, request.body.reportFilters ?? original.url, request.body.reportId, jwtClaims.sub]);
`, [request.body.reportName ?? original.name, JSON.stringify(request.body.reportFilters ?? original.filters), request.body.reportId, jwtClaims.sub]);
await db.clean();

return {
Expand Down

0 comments on commit 5792c58

Please sign in to comment.