Skip to content

Commit

Permalink
chapter member view
Browse files Browse the repository at this point in the history
  • Loading branch information
johnny-t06 committed Apr 11, 2024
1 parent 7e01f10 commit f96c4e2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/app/private/chapter-leader/users/MembersHomePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const MembersHomePage = ({ members }: MembersHomePageProps) => {

const displayMembers = (elem: User, index: number) => (
<UserTile
key={index}
key={elem.id}
student={elem}
link={`/private/chapter-leader/users/${elem.id}`}
dropdownComponent={
Expand Down
13 changes: 9 additions & 4 deletions src/app/private/chapter-leader/users/[userId]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
import PathNav from "@components/PathNav";
import DisplayUserSenior from "@components/user/DisplayUserSeniors";
import { prisma } from "@server/db/client";
import { getServerSessionOrRedirect } from "@server/utils";
import { fullName } from "@utils";

const Page = async () => {
const session = await getServerSessionOrRedirect();
interface Params {
params: {
userId: string;
};
}

const Page = async ({ params }: Params) => {
const { userId } = params;
const user = await prisma.user.findUniqueOrThrow({
where: {
id: session.user?.id,
id: userId,
},
include: {
Chapter: {
Expand Down
7 changes: 5 additions & 2 deletions src/app/private/user/seniors/[seniorId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,13 @@ const Page = async ({ params }: PageProps) => {
<div className="flex flex-col gap-y-6">
<PathNav
pathInfo={[
{ display: "Seniors", url: `/private/user/seniors` },
{
display: "Seniors",
url: `seniors`,
},
{
display: `${senior.firstname} ${senior.lastname}`,
url: `/private/seniors/${senior.id}`,
url: `seniors/${senior.id}`,
},
]}
/>
Expand Down

0 comments on commit f96c4e2

Please sign in to comment.