This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
// SPDX-License-Identifier: LicenseRef-ConusAI-Template-1.0
|
||||
// The project layout: the project has to exist in this workspace of this organization, and a project
|
||||
// of another tenant, an unknown slug and a project the person has no place in are one 404, answered
|
||||
// before the response streams (spec §3.3). `tenancy.project.get` resolves the whole path from the
|
||||
// organization down, each step a scoped read, so nothing here re-implements the wall.
|
||||
|
||||
import { projectGet } from "@conusai-kit/tenancy"
|
||||
import type { ReactNode } from "react"
|
||||
import { orFallback } from "../../../../src/server/guard"
|
||||
import { pageContext } from "../../../../src/server/page"
|
||||
|
||||
export const dynamic = "force-dynamic"
|
||||
|
||||
export default async function ProjectLayout({
|
||||
children,
|
||||
params,
|
||||
}: {
|
||||
children: ReactNode
|
||||
params: Promise<{ org: string; workspace: string; project: string }>
|
||||
}): Promise<ReactNode> {
|
||||
const { org, workspace, project } = await params
|
||||
const { caller, path } = await pageContext()
|
||||
await orFallback(path, () => caller.call(projectGet, { org, workspace, project }))
|
||||
return children
|
||||
}
|
||||
Reference in New Issue
Block a user