summary refs log tree commit diff
path: root/src/api/routes
diff options
context:
space:
mode:
authorPuyodead1 <puyodead@protonmail.com>2022-09-01 11:05:38 -0400
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-12-19 20:43:54 +1100
commitae199e3445db6f1337de60d567e357f8ffc8706f (patch)
tree28a4fdf1c0c15e5e445d43d10e81f6697ae5d337 /src/api/routes
parentFix config loading (diff)
downloadserver-ae199e3445db6f1337de60d567e357f8ffc8706f.tar.xz
fix user profile not displaying correctly
Diffstat (limited to 'src/api/routes')
-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 45cc4412..083d44af 100644
--- a/src/api/routes/users/#id/profile.ts
+++ b/src/api/routes/users/#id/profile.ts
@@ -89,6 +89,12 @@ router.get(
 			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,
@@ -120,8 +126,9 @@ router.get(
 		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
 	});
 });