From 294ea785d7cf8b2c6adbc8f60a602c6291e7ee5f Mon Sep 17 00:00:00 2001 From: Nate Kelley Date: Wed, 16 Apr 2025 12:22:40 -0600 Subject: [PATCH] dashboard get versions --- web/src/context/Assets/BusterAssetsProvider.tsx | 2 +- web/src/context/Dashboards/useGetDashboardMemoized.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/web/src/context/Assets/BusterAssetsProvider.tsx b/web/src/context/Assets/BusterAssetsProvider.tsx index c7f5455dc..ca2c62ee8 100644 --- a/web/src/context/Assets/BusterAssetsProvider.tsx +++ b/web/src/context/Assets/BusterAssetsProvider.tsx @@ -30,7 +30,7 @@ const useBusterAssets = () => { }); } else if (type === 'dashboard') { await queryClient.invalidateQueries({ - queryKey: queryKeys.dashboardGetDashboard(assetId).queryKey + queryKey: queryKeys.dashboardGetDashboard(assetId, undefined).queryKey }); } else if (type === 'collection') { await queryClient.invalidateQueries({ diff --git a/web/src/context/Dashboards/useGetDashboardMemoized.tsx b/web/src/context/Dashboards/useGetDashboardMemoized.tsx index 4dffa5950..db8870af0 100644 --- a/web/src/context/Dashboards/useGetDashboardMemoized.tsx +++ b/web/src/context/Dashboards/useGetDashboardMemoized.tsx @@ -4,8 +4,8 @@ import { useQueryClient } from '@tanstack/react-query'; export const useGetDashboardMemoized = () => { const queryClient = useQueryClient(); - const getDashboardMemoized = useMemoizedFn((dashboardId: string) => { - const options = dashboardQueryKeys.dashboardGetDashboard(dashboardId); + const getDashboardMemoized = useMemoizedFn((dashboardId: string, versionNumber?: number) => { + const options = dashboardQueryKeys.dashboardGetDashboard(dashboardId, versionNumber); const data = queryClient.getQueryData(options.queryKey); return data; });