mirror of
https://github.com/bluewave-labs/Checkmate.git
synced 2026-05-19 16:08:39 -05:00
Merge pull request #3012 from bluewave-labs/fix/keep-previous-data
fix/v2: add keep previous data
This commit is contained in:
@@ -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,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,
|
||||
|
||||
Reference in New Issue
Block a user