1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-22 18:32:29 +01:00

Merge pull request #879 from Puyodead1/fix/user-profiles

fix user profile not displaying correctly
This commit is contained in:
TheArcaneBrony 2022-09-04 03:24:10 +02:00 committed by GitHub
commit 5d321d2139
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -73,6 +73,12 @@ router.get("/", route({ test: { response: { body: "UserProfileResponse" } } }),
bot: user.bot bot: user.bot
}; };
const userProfile = {
bio: req.user_bot ? null : user.bio,
accent_color: user.accent_color,
banner: user.banner
};
const guildMemberDto = guild_member const guildMemberDto = guild_member
? { ? {
avatar: guild_member.avatar, avatar: guild_member.avatar,
@ -104,8 +110,9 @@ router.get("/", route({ test: { response: { body: "UserProfileResponse" } } }),
premium_since: user.premium_since, // TODO premium_since: user.premium_since, // TODO
mutual_guilds: mutual_guilds, // TODO {id: "", nick: null} when ?with_mutual_guilds=true mutual_guilds: mutual_guilds, // TODO {id: "", nick: null} when ?with_mutual_guilds=true
user: userDto, user: userDto,
guild_member: guildMemberDto, user_profile: userProfile,
guild_member_profile: guildMemberProfile guild_member: guild_id && guildMemberDto,
guild_member_profile: guild_id && guildMemberProfile
}); });
}); });