feat: add LocationResult type and locationResults to Check model

## Changes
- Add LocationResult interface to server check types
- Add locationResults optional field to Check interface
- Add GlobalpingCheckResult interface to network types
- Add locationResultSchema subdocument and locationResults field to Mongoose Check schema
- Fix formatting in pre-existing files (SettingsGlobalping, Settings index, UptimeMonitorsTable, monitorService)

## Benefits
Non-destructive addition of the data model needed to store per-location
Globalping results inside a single Check document. No existing behaviour
is changed.
This commit is contained in:
gorkem-bwl committed 2026-02-20 01:31:31 -05:00
1 parent b7c9e2710a
commit d25ce9e498
11 files changed
+87 -44

No files matched your search

@@ -226,12 +226,7 @@ export class MonitorService implements IMonitorService {
// Fetch location checks if Globalping is enabled for this monitor
let locationChecks: Record<string, LocationCheckData> | undefined;
if (monitor.globalpingEnabled && (monitor.type === "http" || monitor.type === "ping")) {
const locData = await this.checksRepository.findLocationChecksByMonitorId(
monitor.id,
start,
end,
this.getDateFormat(rangeKey)
);
const locData = await this.checksRepository.findLocationChecksByMonitorId(monitor.id, start, end, this.getDateFormat(rangeKey));
if (Object.keys(locData).length > 0) {
locationChecks = locData;
}