infra fix

This commit is contained in:
Alex Holliday committed 2026-01-16 18:37:14 +00:00
1 parent 0d7a35367f
commit d633fc5ccb
3 files changed
+42 -28

No files matched your search

@@ -61,7 +61,7 @@ const useInfrastructureSubmit = () => {
};
const finalForm = {
...(isCreate ? {} : { _id: monitorId }),
...(isCreate ? {} : { id: monitorId }),
...rest,
description: form.name,
type: "hardware",
@@ -22,9 +22,9 @@ import { useTranslation } from "react-i18next";
import {
useDeleteMonitor,
useFetchGlobalSettings,
useFetchHardwareMonitorById,
useFetchMonitorById,
usePauseMonitor,
} from "../../../Hooks/monitorHooks.js";
} from "@/Hooks/monitorHooks.js";
import useInfrastructureMonitorForm from "./hooks/useInfrastructureMonitorForm.jsx";
import useValidateInfrastructureForm from "./hooks/useValidateInfrastructureForm.jsx";
import useInfrastructureSubmit from "./hooks/useInfrastructureSubmit.jsx";
@@ -37,14 +37,16 @@ const CreateInfrastructureMonitor = () => {
const { t } = useTranslation();
// State
const [monitor, setMonitor] = useState(null);
const [https, setHttps] = useState(false);
const [updateTrigger, setUpdateTrigger] = useState(false);
const [availableDisks, setAvailableDisks] = useState([]);
// Fetch monitor details if editing
const [monitor, isLoading] = useFetchHardwareMonitorById({
const [isLoading] = useFetchMonitorById({
monitorId,
updateTrigger,
setMonitor,
updateTrigger: true,
});
const [deleteMonitor, isDeleting] = useDeleteMonitor();
const [globalSettings, globalSettingsLoading] = useFetchGlobalSettings();
@@ -150,8 +152,7 @@ const CreateInfrastructureMonitor = () => {
const handleRemove = async (event) => {
event.preventDefault();
const TEMP_MONITOR = { id: monitor._id };
await deleteMonitor({ monitor: TEMP_MONITOR, redirect: "/infrastructure" });
await deleteMonitor({ monitor, redirect: "/infrastructure" });
};
const isBusy =