diff --git a/client/src/Hooks/checkHooks.js b/client/src/Hooks/checkHooks.js index 6fd48e828..bdb1a73b7 100644 --- a/client/src/Hooks/checkHooks.js +++ b/client/src/Hooks/checkHooks.js @@ -185,47 +185,6 @@ const useResolveIncident = () => { return [resolveIncident, isLoading]; }; -const useAckMonitorChecks = () => { - const [isLoading, setIsLoading] = useState(false); - const { t } = useTranslation(); - - const ackMonitorChecks = async (monitorId, setUpdateTrigger) => { - try { - setIsLoading(true); - await networkService.updateMonitorChecksStatus({ - monitorId, - ack: true, - }); - setUpdateTrigger((prev) => !prev); - } catch (error) { - createToast({ body: t("checkHooks.failureResolveMonitor") }); - } finally { - setIsLoading(false); - } - }; - - return [ackMonitorChecks, isLoading]; -}; - -const useAckAllChecks = () => { - const [isLoading, setIsLoading] = useState(false); - const { t } = useTranslation(); - - const ackAllChecks = async (setUpdateTrigger) => { - try { - setIsLoading(true); - await networkService.updateAllChecksStatus({ ack: true }); - setUpdateTrigger((prev) => !prev); - } catch (error) { - createToast({ body: t("checkHooks.failureResolveAll") }); - } finally { - setIsLoading(false); - } - }; - - return [ackAllChecks, isLoading]; -}; - const useAcknowledgeChecks = () => { const [isLoading, setIsLoading] = useState(false); const { t } = useTranslation(); @@ -257,7 +216,5 @@ export { useFetchChecksTeam, useFetchChecksSummaryByTeamId, useResolveIncident, - useAckMonitorChecks, - useAckAllChecks, useAcknowledgeChecks, }; diff --git a/client/src/Pages/Incidents/index.jsx b/client/src/Pages/Incidents/index.jsx index d963db9e7..7696c453b 100644 --- a/client/src/Pages/Incidents/index.jsx +++ b/client/src/Pages/Incidents/index.jsx @@ -11,11 +11,7 @@ import { Box, Button } from "@mui/material"; import { useTheme } from "@emotion/react"; import { useFetchMonitorsByTeamId } from "../../Hooks/monitorHooks"; import { useFetchChecksSummaryByTeamId } from "../../Hooks/checkHooks"; -import { - useAckAllChecks, - useAckMonitorChecks, - useAcknowledgeChecks, -} from "../../Hooks/checkHooks"; +import { useAcknowledgeChecks } from "../../Hooks/checkHooks"; import { useState, useEffect } from "react"; import NetworkError from "../../Components/GenericFallback/NetworkError"; import { useTranslation } from "react-i18next"; @@ -38,8 +34,6 @@ const Incidents = () => { const [updateTrigger, setUpdateTrigger] = useState(false); //Hooks - const [ackAllChecks, ackAllLoading] = useAckAllChecks(); - const [ackMonitorChecks, ackMonitorLoading] = useAckMonitorChecks(); const { acknowledge, isLoadingAcknowledge } = useAcknowledgeChecks(); //Utils @@ -68,14 +62,6 @@ const Incidents = () => { setMonitorLookup(monitorLookup); }, [monitors]); - const handleAckAllChecks = () => { - if (selectedMonitor === "0") { - ackAllChecks(setUpdateTrigger); - } else { - ackMonitorChecks(selectedMonitor, setUpdateTrigger); - } - }; - const handleAcknowledge = () => { const monitorId = selectedMonitor === "0" ? null : selectedMonitor; acknowledge(setUpdateTrigger, monitorId);