Openstatus www.openstatus.dev

fix: sync page-components monitor deletion (#1780)

authored by

Maximilian Kaske and committed by
GitHub
c3ba430b d749db5e

+8 -1
+8 -1
packages/api/src/router/statusReport.ts
··· 9 9 gte, 10 10 inArray, 11 11 sql, 12 + syncStatusReportToMonitorDelete, 12 13 syncStatusReportToMonitorDeleteByStatusReport, 13 14 syncStatusReportToMonitorInsertMany, 14 15 } from "@openstatus/db"; ··· 174 175 ), 175 176 ) 176 177 .run(); 177 - // Sync delete is handled by cascade on page_component deletion 178 + // Sync delete to page components for each removed monitor 179 + for (const monitorId of removedMonitors) { 180 + await syncStatusReportToMonitorDelete(opts.ctx.db, { 181 + statusReportId: currentStatusReport.id, 182 + monitorId, 183 + }); 184 + } 178 185 } 179 186 180 187 return currentStatusReport;