Skip to content

Commit

Permalink
Fix route bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
nickbar01234 committed Apr 4, 2024
1 parent 28c3863 commit 3a13cdf
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 13 deletions.
13 changes: 10 additions & 3 deletions src/app/private/[uid]/user/home/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,16 @@ const UserHomePage = async ({ params }: UserHomePageParams) => {
include: {
students: {
where: {
position: {
not: "",
},
OR: [
{
position: {
not: "",
},
},
{
role: "CHAPTER_LEADER",
},
],
},
},
},
Expand Down
20 changes: 10 additions & 10 deletions src/components/DisplayChapterInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const DisplayChapterInfo = ({
<PendingCard
key={index}
name={fullName(user.user)}
uid={user.id}
uid={user.user.id}
/>
);
})}
Expand All @@ -91,15 +91,15 @@ const DisplayChapterInfo = ({
: "Executive Board"}
</div>
}
tiles={students.map((student) => (
<UserTile
key={student.id}
student={student}
link={`/private/${user.id}/${RoleToUrlSegment[user.role]}/users/${
student.id
}`}
/>
))}
tiles={students.map((student) => {
const link =
user.role === "USER"
? ""
: `/private/${user.id}/${RoleToUrlSegment[user.role]}` +
`${user.role === "ADMIN" && `/home/chapters/${chapter.id}`}` +
`/users/${student.id}`;
return <UserTile key={student.id} student={student} link={link} />;
})}
/>
</div>
<div className="flex flex-col gap-y-6">
Expand Down

0 comments on commit 3a13cdf

Please sign in to comment.