[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

View File

@@ -292,4 +292,3 @@ describe("Environment Access Fallback", () => {
});
});
});

View File

@@ -290,9 +290,8 @@ export const ShowProjects = () => {
// Find default environment from accessible environments, or fall back to first accessible environment
const accessibleEnvironment =
project?.environments.find(
(env) => env.isDefault,
) || project?.environments?.[0];
project?.environments.find((env) => env.isDefault) ||
project?.environments?.[0];
return (
<div

View File

@@ -1628,9 +1628,10 @@ export async function getServerSideProps(
});
} catch (error) {
// If user doesn't have access to requested environment, redirect to accessible one
const accessibleEnvironments = await helpers.environment.byProjectId.fetch({
projectId: params.projectId,
});
const accessibleEnvironments =
await helpers.environment.byProjectId.fetch({
projectId: params.projectId,
});
if (accessibleEnvironments.length > 0) {
// Try to find default, otherwise use first accessible