Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions app/team/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { requireHackerPage } from "@/lib/auth/guards";
import {
getMyTeam,
getMyPendingInvitations,
getSentInvitations,
} from "@/lib/actions/team.actions";
import { TeamView } from "./team-view";

// Not wrapped in a swallow-and-degrade try/catch the way apply/page.tsx
// handles its existing-application check — silently falling back to "no
// team" on a fetch error here would let a user attempt to create a second
// team while one already exists, so a failure here throws to Next.js's
// default error handling instead.
export default async function TeamPage() {
const { id: userId } = await requireHackerPage();

const [team, pendingInvitations, sentInvitations] = await Promise.all([
getMyTeam(userId),
getMyPendingInvitations(userId),
getSentInvitations(userId),
]);

return (
<TeamView
currentUserId={userId}
team={team}
pendingInvitations={pendingInvitations}
sentInvitations={sentInvitations}
/>
);
}
Loading
Loading