reload on team change

This commit is contained in:
Alex Holliday committed 2025-12-15 19:39:23 +00:00
1 parent 4e3630465c
commit e4183baf75
6 files changed
+37 -7

No files matched your search

+15 -1
View File
@@ -8,6 +8,9 @@ import type { IStatusPage } from "@/types/status-page";
import { useGet, useDelete } from "@/hooks/UseApi";
import type { ApiResponse } from "@/hooks/UseApi";
import { useTranslation } from "react-i18next";
import { config } from "@/config/index";
const GLOBAL_REFRESH = config.GLOBAL_REFRESH;
const StatusPages = () => {
const [page, setPage] = useState(0);
@@ -19,7 +22,18 @@ const StatusPages = () => {
const { response, isValidating, error, refetch } = useGet<
ApiResponse<{ statusPages: IStatusPage[]; count: number }>
>(`/status-pages?page=${page}&rowsPerPage=${rowsPerPage}`, {}, {});
>(
`/status-pages?page=${page}&rowsPerPage=${rowsPerPage}`,
{},
{
refreshInterval: GLOBAL_REFRESH,
keepPreviousData: true,
dedupingInterval: 0,
},
{
useTeamIdAsKey: true,
}
);
const statusPages = response?.data?.statusPages || [];
const count = response?.data?.count || 0;