update montior form hook to load method

This commit is contained in:
Alex Holliday committed 2026-06-22 11:07:56 -07:00
1 parent d84fc7e299
commit a31dd2f19e
1 file changed
+3 -1
+3 -1
View File
@@ -1,6 +1,6 @@
import { useMemo } from "react"; import { useMemo } from "react";
import { monitorSchema, type MonitorFormData } from "@/Validation/monitor"; import { monitorSchema, type MonitorFormData } from "@/Validation/monitor";
import { DefaultPageSpeedStrategy } from "@/Types/Monitor"; import { DefaultHttpMethod, DefaultPageSpeedStrategy } from "@/Types/Monitor";
import type { Monitor, MonitorType } from "@/Types/Monitor"; import type { Monitor, MonitorType } from "@/Types/Monitor";
interface UseMonitorFormOptions { interface UseMonitorFormOptions {
@@ -40,6 +40,7 @@ export const getMonitorDefaults = (
...getGeoCheckDefaults(data), ...getGeoCheckDefaults(data),
type: "http", type: "http",
url: data?.url || "", url: data?.url || "",
method: data?.method ?? DefaultHttpMethod,
ignoreTlsErrors: data?.ignoreTlsErrors || false, ignoreTlsErrors: data?.ignoreTlsErrors || false,
useAdvancedMatching: data?.useAdvancedMatching || false, useAdvancedMatching: data?.useAdvancedMatching || false,
matchMethod: data?.matchMethod || "", matchMethod: data?.matchMethod || "",
@@ -134,6 +135,7 @@ export const getMonitorDefaults = (
...getGeoCheckDefaults(data), ...getGeoCheckDefaults(data),
type: "http", type: "http",
url: "", url: "",
method: DefaultHttpMethod,
ignoreTlsErrors: false, ignoreTlsErrors: false,
useAdvancedMatching: false, useAdvancedMatching: false,
matchMethod: "", matchMethod: "",