From 6bf551b499ec3e476674ac0bc776658186937a92 Mon Sep 17 00:00:00 2001 From: Nate Kelley Date: Mon, 14 Jul 2025 13:26:45 -0600 Subject: [PATCH] default version number is 1 --- .../web/src/api/buster_rest/dashboards/dashboardQueryHelpers.ts | 2 +- apps/web/src/api/buster_rest/dashboards/queryRequests.ts | 2 +- apps/web/src/api/buster_rest/metrics/getMetricQueryRequests.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/web/src/api/buster_rest/dashboards/dashboardQueryHelpers.ts b/apps/web/src/api/buster_rest/dashboards/dashboardQueryHelpers.ts index 58b5cfd67..259805ecf 100644 --- a/apps/web/src/api/buster_rest/dashboards/dashboardQueryHelpers.ts +++ b/apps/web/src/api/buster_rest/dashboards/dashboardQueryHelpers.ts @@ -91,7 +91,7 @@ export const useGetDashboardAndInitializeMetrics = (prefetchData = true) => { .queryKey, data ); - onSetLatestDashboardVersion(data.dashboard.id, last(data.versions)?.version_number || 0); + onSetLatestDashboardVersion(data.dashboard.id, last(data.versions)?.version_number || 1); } return data; diff --git a/apps/web/src/api/buster_rest/dashboards/queryRequests.ts b/apps/web/src/api/buster_rest/dashboards/queryRequests.ts index 20662f6f2..17669b8cc 100644 --- a/apps/web/src/api/buster_rest/dashboards/queryRequests.ts +++ b/apps/web/src/api/buster_rest/dashboards/queryRequests.ts @@ -110,7 +110,7 @@ export const useSaveDashboard = (params?: { updateOnSave?: boolean }) => { data ); setOriginalDashboard(data.dashboard); - onSetLatestDashboardVersion(data.dashboard.id, last(data.versions)?.version_number || 0); + onSetLatestDashboardVersion(data.dashboard.id, last(data.versions)?.version_number || 1); } } }); diff --git a/apps/web/src/api/buster_rest/metrics/getMetricQueryRequests.ts b/apps/web/src/api/buster_rest/metrics/getMetricQueryRequests.ts index 27d1956cc..7f80096d0 100644 --- a/apps/web/src/api/buster_rest/metrics/getMetricQueryRequests.ts +++ b/apps/web/src/api/buster_rest/metrics/getMetricQueryRequests.ts @@ -56,7 +56,7 @@ export const useGetMetric = ( if (isLatestVersion) { setOriginalMetric(updatedMetric); } - onSetLatestMetricVersion(id || '', last(updatedMetric.versions)?.version_number || 0); + onSetLatestMetricVersion(id || '', last(updatedMetric.versions)?.version_number || 1); if (result?.version_number) { queryClient.setQueryData( metricsQueryKeys.metricsGetMetric(result.id, result.version_number).queryKey,