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

fix/v2: add keep previous data
This commit is contained in:
Alexander Holliday
2025-10-08 15:29:41 -07:00
committed by GitHub
2 changed files with 5 additions and 6 deletions
+5 -5
View File
@@ -29,7 +29,7 @@ const UptimeDetailsPage = () => {
`/monitors/${id}?embedChecks=true&range=${range}`,
{},
{ refreshInterval: 30000 }
{ refreshInterval: 30000, keepPreviousData: true }
);
const {
@@ -39,7 +39,7 @@ const UptimeDetailsPage = () => {
} = useGet<ApiResponse>(
`/monitors/${id}?embedChecks=true&range=${range}&status=up`,
{},
{}
{ keepPreviousData: true }
);
const {
@@ -49,7 +49,7 @@ const UptimeDetailsPage = () => {
} = useGet<ApiResponse>(
`/monitors/${id}?embedChecks=true&range=${range}&status=down`,
{},
{}
{ keepPreviousData: true }
);
const { patch, loading: isPatching, error: postError } = usePatch<ApiResponse>();
@@ -78,7 +78,7 @@ const UptimeDetailsPage = () => {
? [...downResponse.data.checks].reverse()
: [];
const palette = getStatusPalette(monitor.status);
const palette = getStatusPalette(monitor?.status);
if (error || upError || downError || postError) {
console.error("Error fetching monitor data:", {
@@ -149,7 +149,7 @@ const UptimeDetailsPage = () => {
checks={checks}
range={range}
/>
<CheckTable monitorId={monitor._id} />
<CheckTable monitorId={monitor?._id} />
</BasePage>
);
};
-1
View File
@@ -1,7 +1,6 @@
import axios from "axios";
import type { AxiosRequestConfig, AxiosResponse } from "axios";
const BASE_URL = import.meta.env.VITE_APP_API_V2_BASE_URL;
const api = axios.create({
baseURL: BASE_URL || "http://localhost:55555/api/v2",
withCredentials: true,