a tool for shared writing and social publishing
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

use publication draft metadata if available

+10 -5
+10 -5
app/[leaflet_id]/page.tsx
··· 70 70 } 71 71 72 72 export async function generateMetadata(props: Props): Promise<Metadata> { 73 - let res = await supabaseServerClient 74 - .from("permission_tokens") 75 - .select("*, permission_token_rights(*)") 76 - .eq("id", (await props.params).leaflet_id) 77 - .single(); 73 + let { result: res } = await get_leaflet_data.handler( 74 + { token_id: (await props.params).leaflet_id }, 75 + { supabase: supabaseServerClient }, 76 + ); 78 77 let rootEntity = res.data?.root_entity; 79 78 if (!rootEntity || !res.data) return { title: "Leaflet not found" }; 79 + if (res.data.leaflets_in_publications[0]) { 80 + return { 81 + title: res.data.leaflets_in_publications[0].title || "Untitled", 82 + description: res.data.leaflets_in_publications[0].description, 83 + }; 84 + } 80 85 let { data } = await supabaseServerClient.rpc("get_facts", { 81 86 root: rootEntity, 82 87 });