diff --git a/src/app/sunum/[token]/page.tsx b/src/app/sunum/[token]/page.tsx index f99ebdf..c6173f8 100644 --- a/src/app/sunum/[token]/page.tsx +++ b/src/app/sunum/[token]/page.tsx @@ -18,7 +18,7 @@ interface Props { export default async function SunumPage({ params }: Props) { const { token } = await params; - const { tablesDB } = createAdminClient(); + const { tablesDB, teams, users } = createAdminClient(); const result = await tablesDB.listRows({ databaseId: DATABASE_ID, @@ -46,6 +46,13 @@ export default async function SunumPage({ params }: Props) { void incrementPresentationViewCount(presentation.$id, presentation.viewCount ?? 0); + const [creatorResult, teamResult] = await Promise.allSettled([ + users.get(presentation.createdBy), + teams.get(presentation.tenantId), + ]); + const creatorName = creatorResult.status === "fulfilled" ? creatorResult.value.name : null; + const companyName = teamResult.status === "fulfilled" ? teamResult.value.name : null; + let propertyIds: string[] = []; try { propertyIds = JSON.parse(presentation.propertyIds) as string[]; @@ -78,11 +85,18 @@ export default async function SunumPage({ params }: Props) { {presentation.notes}
)} -