mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-15 16:52:38 +00:00
42 lines
1.3 KiB
TypeScript
42 lines
1.3 KiB
TypeScript
import { createFileRoute, linkOptions } from "@tanstack/react-router";
|
|
|
|
import { workspaceKeys } from "@app/hooks/api";
|
|
import { fetchUserProjectPermissions, roleQueryKeys } from "@app/hooks/api/roles/queries";
|
|
import { fetchWorkspaceById } from "@app/hooks/api/workspace/queries";
|
|
import { ProjectLayout } from "@app/layouts/ProjectLayout";
|
|
|
|
export const Route = createFileRoute(
|
|
"/_authenticate/_inject-org-details/_org-layout/kms/$projectId/_kms-layout"
|
|
)({
|
|
component: ProjectLayout,
|
|
beforeLoad: async ({ params, context }) => {
|
|
const project = await context.queryClient.ensureQueryData({
|
|
queryKey: workspaceKeys.getWorkspaceById(params.projectId),
|
|
queryFn: () => fetchWorkspaceById(params.projectId)
|
|
});
|
|
|
|
await context.queryClient.ensureQueryData({
|
|
queryKey: roleQueryKeys.getUserProjectPermissions({
|
|
workspaceId: params.projectId
|
|
}),
|
|
queryFn: () => fetchUserProjectPermissions({ workspaceId: params.projectId })
|
|
});
|
|
|
|
return {
|
|
breadcrumbs: [
|
|
{
|
|
label: "KMS",
|
|
link: linkOptions({ to: "/organization/kms/overview" })
|
|
},
|
|
{
|
|
label: project.name,
|
|
link: linkOptions({
|
|
to: "/kms/$projectId/overview",
|
|
params: { projectId: project.id }
|
|
})
|
|
}
|
|
]
|
|
};
|
|
}
|
|
});
|