Skip to main content

Function: updateMonitorInSite()

function updateMonitorInSite(
site: Site,
monitorId: string,
updates: Partial<Monitor>
): Site;

Defined in: src/stores/sites/utils/monitorOperations.ts:149

Updates a monitor in a site.

Parametersโ€‹

siteโ€‹

Site

The site containing the monitor.

monitorIdโ€‹

string

The ID of the monitor to update.

updatesโ€‹

Partial<Monitor>

Partial monitor updates to apply.

Returnsโ€‹

Site

Updated site with modified monitor.

Exampleโ€‹

const updatedSite = updateMonitorInSite(site, "monitor-123", {
timeout: 10000,
});

Throwsโ€‹

Error if monitor is not found.