All Incidents Resolve Hook

This commit is contained in:
Br0wnHammer committed 2025-07-04 01:29:52 +05:30
1 parent 30131c97a3
commit 8a4fba056b
2 files changed
+26 -9

No files matched your search

+19
View File
@@ -183,9 +183,28 @@ const useResolveIncident = () => {
return [resolveIncident, isLoading];
};
const useAckAllChecks = () => {
const [isLoading, setIsLoading] = useState(false);
const ackAllChecks = async (setUpdateTrigger) => {
try {
setIsLoading(true);
await networkService.updateAllChecksStatus({ ack: true });
setUpdateTrigger((prev) => !prev);
} catch (error) {
createToast({ body: "Failed to resolve all incidents." });
} finally {
setIsLoading(false);
}
};
return [ackAllChecks, isLoading];
};
export {
useFetchChecksByMonitor,
useFetchChecksTeam,
useFetchChecksSummaryByTeamId,
useResolveIncident,
useAckAllChecks,
};