Skip to content

Commit

Permalink
feat: Fetch and initial board member on load
Browse files Browse the repository at this point in the history
  • Loading branch information
DW225 committed Sep 23, 2024
1 parent 2a4970e commit 7d0f8fb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/board/[id]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { BoardAccess, BoardGrid } from "@/components/board";
import { PostProvider } from "@/components/board/PostProvider";
import { NavBar } from "@/components/common";
import { checkMemberRole } from "@/lib/db/member";
import { checkMemberRole, fetchMembersByBoardID } from "@/lib/db/member";
import { fetchPostsByBoardID } from "@/lib/db/post";
import { findUserIdByKindeID } from "@/lib/db/user";
import { getKindeServerSession } from "@kinde-oss/kinde-auth-nextjs/server";
Expand Down Expand Up @@ -33,11 +33,12 @@ export default async function BoardPage({ params }: BoardPageProps) {
}

const posts = await fetchPostsByBoardID(boardID);
const members = await fetchMembersByBoardID(boardID);

return (
<>
<NavBar />
<PostProvider initialPosts={posts}>
<PostProvider initialPosts={posts} initialMembers={members}>
<div className="container mx-auto w-full max-w-full px-4">
<div className="flex justify-end">
<BoardAccess boardId={boardID} role={role} />
Expand Down

0 comments on commit 7d0f8fb

Please sign in to comment.