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,