[autofix.ci] apply automated fixes

This commit is contained in:
autofix-ci[bot]
2026-01-05 16:23:54 +00:00
committed by GitHub
parent 611b0b3113
commit 9e8c3f1525
3 changed files with 6 additions and 7 deletions
@@ -292,4 +292,3 @@ describe("Environment Access Fallback", () => {
}); });
}); });
}); });
@@ -290,9 +290,8 @@ export const ShowProjects = () => {
// Find default environment from accessible environments, or fall back to first accessible environment // Find default environment from accessible environments, or fall back to first accessible environment
const accessibleEnvironment = const accessibleEnvironment =
project?.environments.find( project?.environments.find((env) => env.isDefault) ||
(env) => env.isDefault, project?.environments?.[0];
) || project?.environments?.[0];
return ( return (
<div <div
@@ -1628,9 +1628,10 @@ export async function getServerSideProps(
}); });
} catch (error) { } catch (error) {
// If user doesn't have access to requested environment, redirect to accessible one // If user doesn't have access to requested environment, redirect to accessible one
const accessibleEnvironments = await helpers.environment.byProjectId.fetch({ const accessibleEnvironments =
projectId: params.projectId, await helpers.environment.byProjectId.fetch({
}); projectId: params.projectId,
});
if (accessibleEnvironments.length > 0) { if (accessibleEnvironments.length > 0) {
// Try to find default, otherwise use first accessible // Try to find default, otherwise use first accessible