summary refs log tree commit diff
diff options
context:
space:
mode:
authorTheArcaneBrony <myrainbowdash949@gmail.com>2022-09-04 03:24:10 +0200
committerGitHub <noreply@github.com>2022-09-04 03:24:10 +0200
commit5d321d21396e82dfc13d3e9794ed0827ec480c7b (patch)
treed65753ec6ba2c1c684f64e89f7f3107fff03e230
parentMerge pull request #872 from Puyodead1/feat/guild-profiles (diff)
parentfix user profile not displaying correctly (diff)
downloadserver-5d321d21396e82dfc13d3e9794ed0827ec480c7b.tar.xz
Merge pull request #879 from Puyodead1/fix/user-profiles
fix user profile not displaying correctly
-rw-r--r--src/api/routes/users/#id/profile.ts11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/api/routes/users/#id/profile.ts b/src/api/routes/users/#id/profile.ts

index 0b9107e2..541bb66a 100644 --- a/src/api/routes/users/#id/profile.ts +++ b/src/api/routes/users/#id/profile.ts
@@ -73,6 +73,12 @@ router.get("/", route({ test: { response: { body: "UserProfileResponse" } } }), bot: user.bot }; + const userProfile = { + bio: req.user_bot ? null : user.bio, + accent_color: user.accent_color, + banner: user.banner + }; + const guildMemberDto = guild_member ? { avatar: guild_member.avatar, @@ -104,8 +110,9 @@ router.get("/", route({ test: { response: { body: "UserProfileResponse" } } }), premium_since: user.premium_since, // TODO mutual_guilds: mutual_guilds, // TODO {id: "", nick: null} when ?with_mutual_guilds=true user: userDto, - guild_member: guildMemberDto, - guild_member_profile: guildMemberProfile + user_profile: userProfile, + guild_member: guild_id && guildMemberDto, + guild_member_profile: guild_id && guildMemberProfile }); });