mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-20 10:23:57 +00:00
39 lines
1.3 KiB
TypeScript
39 lines
1.3 KiB
TypeScript
import { createFileRoute } from "@tanstack/react-router";
|
|
|
|
import { BreadcrumbTypes } from "@app/components/v2";
|
|
import { workspaceKeys } from "@app/hooks/api";
|
|
import { fetchUserProjectPermissions, roleQueryKeys } from "@app/hooks/api/roles/queries";
|
|
import { fetchWorkspaceById } from "@app/hooks/api/workspace/queries";
|
|
import { ProjectSelect } from "@app/layouts/ProjectLayout/components/ProjectSelect";
|
|
import { SecretManagerLayout } from "@app/layouts/SecretManagerLayout";
|
|
|
|
export const Route = createFileRoute(
|
|
"/_authenticate/_inject-org-details/_org-layout/projects/secret-management/$projectId/_secret-manager-layout"
|
|
)({
|
|
component: SecretManagerLayout,
|
|
|
|
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 {
|
|
project,
|
|
breadcrumbs: [
|
|
{
|
|
type: BreadcrumbTypes.Component,
|
|
component: ProjectSelect
|
|
}
|
|
]
|
|
};
|
|
}
|
|
});
|