Merge pull request #2469 from bluewave-labs/refactor/useFetchChecks

Refactor: useFetchChecks
This commit is contained in:
Alexander Holliday authored and GitHub committed 2025-06-19 09:51:26 +08:00
commit 2df1dc1721
3 files changed
+112 -70

No files matched your search

+12 -11
View File
@@ -18,7 +18,7 @@ import { useTheme } from "@emotion/react";
import { useIsAdmin } from "../../../Hooks/useIsAdmin";
import { useFetchUptimeMonitorById } from "../../../Hooks/monitorHooks";
import useCertificateFetch from "./Hooks/useCertificateFetch";
import { useFetchChecks } from "../../../Hooks/checkHooks";
import { useFetchChecksByMonitor } from "../../../Hooks/checkHooks";
import { useTranslation } from "react-i18next";
// Constants
@@ -66,16 +66,17 @@ const UptimeDetails = () => {
const monitorType = monitor?.type;
const [checks, checksCount, checksAreLoading, checksNetworkError] = useFetchChecks({
monitorId,
type: monitorType,
sortOrder: "desc",
limit: null,
dateRange,
filter: null,
page,
rowsPerPage,
});
const [checks, checksCount, checksAreLoading, checksNetworkError] =
useFetchChecksByMonitor({
monitorId,
type: monitorType,
sortOrder: "desc",
limit: null,
dateRange,
filter: null,
page,
rowsPerPage,
});
// Handlers
const triggerUpdate = () => {