Network Service: Monitor Check Func

This commit is contained in:
Br0wnHammer
2025-07-24 01:42:46 +05:30
parent df97b93a9a
commit 4933d11dfd
3 changed files with 25 additions and 0 deletions

View File

@@ -185,6 +185,23 @@ const useResolveIncident = () => {
return [resolveIncident, isLoading];
};
const useAckMonitorChecks = () => {
const [isLoading, setIsLoading] = useState(false);
const { t } = useTranslation();
const ackMonitorChecks = async (monitorId, setUpdateTrigger) => {
try {
setIsLoading(true);
} catch (error) {
createToast({ body: t("checkHooks.failureResolveMonitor") });
} finally {
setIsLoading(false);
}
};
return [ackMonitorChecks, isLoading];
};
const useAckAllChecks = () => {
const [isLoading, setIsLoading] = useState(false);
const { t } = useTranslation();
@@ -209,5 +226,6 @@ export {
useFetchChecksTeam,
useFetchChecksSummaryByTeamId,
useResolveIncident,
useAckMonitorChecks,
useAckAllChecks,
};

View File

@@ -631,6 +631,12 @@ class NetworkService {
});
}
async updateMonitorChecksStatus(config) {
return this.axiosInstance.put(`/checks/monitor/${config.monitorId}`, {
ack: config.ack,
});
}
async updateAllChecksStatus(config) {
return this.axiosInstance.put(`/checks/team/`, {
ack: config.ack,

View File

@@ -218,6 +218,7 @@
"checkFrequency": "Check frequency",
"checkHooks": {
"failureResolveAll": "Failed to resolve all incidents.",
"failureResolveMonitor": "Failed to resolve monitor incidents.",
"failureResolveOne": "Failed to resolve incident."
},
"checkingEvery": "Checking every",