fix(site): fetch health data only if has permissions (#11062)

This commit is contained in:
Bruno Quaresma
2023-12-06 15:47:58 +00:00
committed by GitHub
parent 43488b44ce
commit 2bc11d2e63
@@ -12,7 +12,9 @@ export const DeploymentBanner: FC = () => {
const deploymentStatsQuery = useQuery(deploymentStats());
const healthQuery = useQuery({
...health(),
enabled: dashboard.experiments.includes("deployment_health_page"),
enabled:
dashboard.experiments.includes("deployment_health_page") &&
permissions.viewDeploymentValues,
});
if (!permissions.viewDeploymentValues || !deploymentStatsQuery.data) {