Merge pull request #3012 from bluewave-labs/fix/keep-previous-data

fix/v2: add keep previous data
This commit is contained in:
Alexander Holliday authored and GitHub committed 2025-10-08 15:29:41 -07:00
commit d58e5cf7ee
2 files changed
+5 -6

No files matched your search

+5 -5
View File
@@ -29,7 +29,7 @@ const UptimeDetailsPage = () => {
`/monitors/${id}?embedChecks=true&range=${range}`, `/monitors/${id}?embedChecks=true&range=${range}`,
{}, {},
{ refreshInterval: 30000 } { refreshInterval: 30000, keepPreviousData: true }
); );
const { const {
@@ -39,7 +39,7 @@ const UptimeDetailsPage = () => {
} = useGet<ApiResponse>( } = useGet<ApiResponse>(
`/monitors/${id}?embedChecks=true&range=${range}&status=up`, `/monitors/${id}?embedChecks=true&range=${range}&status=up`,
{}, {},
{} { keepPreviousData: true }
); );
const { const {
@@ -49,7 +49,7 @@ const UptimeDetailsPage = () => {
} = useGet<ApiResponse>( } = useGet<ApiResponse>(
`/monitors/${id}?embedChecks=true&range=${range}&status=down`, `/monitors/${id}?embedChecks=true&range=${range}&status=down`,
{}, {},
{} { keepPreviousData: true }
); );
const { patch, loading: isPatching, error: postError } = usePatch<ApiResponse>(); const { patch, loading: isPatching, error: postError } = usePatch<ApiResponse>();
@@ -78,7 +78,7 @@ const UptimeDetailsPage = () => {
? [...downResponse.data.checks].reverse() ? [...downResponse.data.checks].reverse()
: []; : [];
const palette = getStatusPalette(monitor.status); const palette = getStatusPalette(monitor?.status);
if (error || upError || downError || postError) { if (error || upError || downError || postError) {
console.error("Error fetching monitor data:", { console.error("Error fetching monitor data:", {
@@ -149,7 +149,7 @@ const UptimeDetailsPage = () => {
checks={checks} checks={checks}
range={range} range={range}
/> />
<CheckTable monitorId={monitor._id} /> <CheckTable monitorId={monitor?._id} />
</BasePage> </BasePage>
); );
}; };
-1
View File
@@ -1,7 +1,6 @@
import axios from "axios"; import axios from "axios";
import type { AxiosRequestConfig, AxiosResponse } from "axios"; import type { AxiosRequestConfig, AxiosResponse } from "axios";
const BASE_URL = import.meta.env.VITE_APP_API_V2_BASE_URL; const BASE_URL = import.meta.env.VITE_APP_API_V2_BASE_URL;
const api = axios.create({ const api = axios.create({
baseURL: BASE_URL || "http://localhost:55555/api/v2", baseURL: BASE_URL || "http://localhost:55555/api/v2",
withCredentials: true, withCredentials: true,