mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-09 13:35:19 +00:00
[autofix.ci] apply automated fixes
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user