diff --git a/src/app/dashboard/page.tsx b/src/app/dashboard/page.tsx index 1975ae1..45fe4f1 100644 --- a/src/app/dashboard/page.tsx +++ b/src/app/dashboard/page.tsx @@ -14,7 +14,7 @@ export default async function DashboardPage() { if (!user) redirect("/login"); const { data: isAdmin } = await supa.rpc("is_admin"); - let pendingHacks: (HackRow & { created_by: string; creator_username: string | null })[] = []; + let pendingHacks: (HackRow & { created_by: string; creator_username: string | null; creator_full_name: string | null })[] = []; if (isAdmin) { const { data: pendingHacksData } = await supa .from("hacks") @@ -27,15 +27,20 @@ export default async function DashboardPage() { const creatorIds = [...new Set(pendingHacksData.map(h => h.created_by as string))]; const { data: profiles } = await supa .from("profiles") - .select("id,username") + .select("id,username,full_name") .in("id", creatorIds); const usernameById = new Map(); - (profiles || []).forEach((p) => usernameById.set(p.id, p.username)); + const fullNameById = new Map(); + (profiles || []).forEach((p) => { + usernameById.set(p.id, p.username); + fullNameById.set(p.id, p.full_name); + }); pendingHacks = pendingHacksData.map((h) => ({ ...h, creator_username: usernameById.get(h.created_by as string) || null, + creator_full_name: fullNameById.get(h.created_by as string) || null, })); } } @@ -130,7 +135,10 @@ export default async function DashboardPage() { -
{creator}
+
+ {h.creator_full_name &&
{h.creator_full_name}
} +
{creator}
+
{createdDate}