mirror of
https://github.com/bluewave-labs/Checkmate.git
synced 2026-01-10 03:39:44 -06:00
Network Service: Monitor Check Func
This commit is contained in:
@@ -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,
|
||||
};
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user