flip status on create

This commit is contained in:
Alex Holliday committed 2026-05-21 10:50:53 -07:00
1 parent 0470eab782
commit fbfb861447
2 files changed
+25 -1

No files matched your search

@@ -107,7 +107,7 @@ export class MaintenanceWindowService implements IMaintenanceWindowService {
});
}
await this.maintenanceWindowsRepository.create({
const created = await this.maintenanceWindowsRepository.create({
teamId,
monitorIds: monitorIDs,
name: name,
@@ -118,6 +118,10 @@ export class MaintenanceWindowService implements IMaintenanceWindowService {
start: start,
end: end,
});
if (isWindowActive(created)) {
await this.monitorsRepository.updateByIds(created.monitorIds, teamId, { status: "maintenance" });
}
};
getMaintenanceWindowById = async ({ id, teamId }: { id: string; teamId: string }) => {