From 7d3abb3f9851857fc5d8e713956889dbd7ec3c2c Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Tue, 24 Feb 2026 17:18:22 +0000 Subject: [PATCH] map fields --- client/src/Hooks/useMonitorForm.ts | 2 +- server/src/repositories/monitors/MongoMonitorsRepository.ts | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/client/src/Hooks/useMonitorForm.ts b/client/src/Hooks/useMonitorForm.ts index 392b5064c..14d6bbd68 100644 --- a/client/src/Hooks/useMonitorForm.ts +++ b/client/src/Hooks/useMonitorForm.ts @@ -14,7 +14,7 @@ const getBaseDefaults = (data?: Monitor | null) => ({ notifications: data?.notifications || [], statusWindowSize: data?.statusWindowSize || 5, statusWindowThreshold: data?.statusWindowThreshold || 60, - geoCheckEnabled: data?.geoCheckEnabled || false, + geoCheckEnabled: data?.geoCheckEnabled ?? false, geoCheckLocations: data?.geoCheckLocations || [], geoCheckInterval: data?.geoCheckInterval || 300000, }); diff --git a/server/src/repositories/monitors/MongoMonitorsRepository.ts b/server/src/repositories/monitors/MongoMonitorsRepository.ts index 4ae4394d4..0e7ca34ee 100644 --- a/server/src/repositories/monitors/MongoMonitorsRepository.ts +++ b/server/src/repositories/monitors/MongoMonitorsRepository.ts @@ -354,6 +354,9 @@ class MongoMonitorsRepository implements IMonitorsRepository { gameId: doc.gameId ?? undefined, group: doc.group ?? null, recentChecks: (doc.recentChecks ?? []).map((check: any) => this.toCheckSnapshot(check)), + geoCheckEnabled: doc.geoCheckEnabled ?? false, + geoCheckLocations: doc.geoCheckLocations ?? [], + geoCheckInterval: doc.geoCheckInterval ?? 300000, createdAt: toDateString(doc.createdAt), updatedAt: toDateString(doc.updatedAt), }; @@ -409,6 +412,9 @@ class MongoMonitorsRepository implements IMonitorsRepository { gameId: doc.gameId ?? undefined, group: doc.group ?? null, recentChecks: (doc.recentChecks ?? []).map((check: any) => this.toCheckSnapshot(check)), + geoCheckEnabled: doc.geoCheckEnabled ?? false, + geoCheckLocations: doc.geoCheckLocations ?? [], + geoCheckInterval: doc.geoCheckInterval ?? 300000, createdAt: toDateString(doc.createdAt), updatedAt: toDateString(doc.updatedAt), };