Skip to content

Commit

Permalink
Merge pull request #72 from ItKlubBozoLagan/dev
Browse files Browse the repository at this point in the history
Add email domain in contest participants page
  • Loading branch information
Antony1060 authored Nov 11, 2024
2 parents cadab69 + da0c70e commit 5a5ab70
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions apps/backend/src/routes/contest/ContestHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -460,12 +460,13 @@ ContestHandler.get("/:contest_id/leaderboard", async (req, res) => {
res,
StatusCodes.OK,
contestMembers
.map((it) => ({
.map((it, _, __, user = users.find((user) => user.id === it.user_id)!) => ({
...it,
...R.pick(users.find((user) => user.id === it.user_id)!, ["full_name"]),
...R.pick(user, ["full_name"]),
...R.pick(organisationMembers.find((member) => member.user_id === it.user_id)!, [
"elo",
]),
email_domain: user.email.split("@").at(-1),
}))
.map((it) => ({ ...it, score: it.score ?? {} }))
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ const MemberBox: FC<MemberBoxProperties> = ({ member, admin }) => {
{t("account.breadcrumbs.creator")}
</Breadcrumb>
)}
<DomainBreadcrumb email={member.email} />
<DomainBreadcrumb email={member.email_domain} />
<RankBreadcrumb specificElo={member.elo} />
{member.full_name}
</div>
Expand Down
2 changes: 1 addition & 1 deletion packages/models/src/ContestMember.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ export type ContestMember = ContestMemberV2;

export type ContestMemberWithInfo = ContestMember & {
full_name: string;
email: string;
email_domain: string;
elo: number;
};

0 comments on commit 5a5ab70

Please sign in to comment.