Skip to content

Commit

Permalink
Show user account info on admin manage user page (#2749)
Browse files Browse the repository at this point in the history
  • Loading branch information
notmd committed Apr 19, 2023
1 parent b4fea53 commit 4270604
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions website/src/pages/admin/manage_user/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ export const getServerSideProps: GetServerSideProps<{ user: User<Role> }, { id:

const local_user = await prisma.user.findUnique({
where: { id: frontendUserId },
select: { role: true },
select: { role: true, accounts: true, email: true },
});

if (!local_user) {
Expand All @@ -184,9 +184,12 @@ export const getServerSideProps: GetServerSideProps<{ user: User<Role> }, { id:

const user = {
...backend_user,
role: (local_user?.role || "general") as Role,
role: (local_user.role || "general") as Role,
accounts: local_user.accounts || [],
email: local_user.email,
};
user.display_name = getValidDisplayName(user.display_name, user.id);

return {
props: {
user,
Expand Down

0 comments on commit 4270604

Please sign in to comment.