fix: missing switch env for apps

This commit is contained in:
Bima42
2025-12-15 10:10:12 +01:00
parent 3e356e6890
commit 3aeb52810c

View File

@@ -91,6 +91,15 @@ const Service = (
const { data: isCloud } = api.settings.isCloud.useQuery();
const { data: auth } = api.user.get.useQuery();
const { data: environments } = api.environment.byProjectId.useQuery({
projectId: data?.environment?.project?.projectId || "",
});
const environmentDropdownItems =
environments?.map((env) => ({
name: env.name,
href: `/dashboard/project/${projectId}/environment/${env.environmentId}`,
})) || [];
return (
<div className="pb-10">
<UseKeyboardNav forPage="application" />
@@ -98,11 +107,11 @@ const Service = (
list={[
{ name: "Projects", href: "/dashboard/projects" },
{
name: data?.environment.project.name || "",
name: data?.environment?.project?.name || "",
},
{
name: data?.environment?.name || "",
href: `/dashboard/project/${projectId}/environment/${environmentId}`,
dropdownItems: environmentDropdownItems,
},
{
name: data?.name || "",