Openstatus www.openstatus.dev

fix: redirect monitor create (#1412)

* fix: redirect monitor create

* fix: resolved only order

authored by

Maximilian Kaske and committed by
GitHub
18d6ebc8 0cb1c224

+6 -4
+1 -1
apps/dashboard/src/app/(dashboard)/monitors/create/page.tsx
··· 33 33 }); 34 34 if (data.active) { 35 35 triggerCheckMutation.mutate({ id: data.id }); 36 - router.push(`/monitors/${data.id}/edit`); 37 36 } 37 + router.push(`/monitors/${data.id}/edit`); 38 38 }, 39 39 }), 40 40 );
+5 -3
apps/status-page/src/app/(status-page)/[domain]/(public)/events/(view)/report/[id]/page.tsx
··· 27 27 28 28 if (!report) return null; 29 29 30 - const firstUpdate = report.statusReportUpdates[0]; 31 - const lastUpdate = 32 - report.statusReportUpdates[report.statusReportUpdates.length - 1]; 30 + const updates = report.statusReportUpdates.sort( 31 + (a, b) => b.date.getTime() - a.date.getTime(), 32 + ); 33 + const firstUpdate = updates[updates.length - 1]; 34 + const lastUpdate = updates[0]; 33 35 34 36 // HACKY: LEGACY: only resolved via report and not via report update 35 37 const isReportResolvedOnly =