diff options
author | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2023-02-05 12:35:27 +1100 |
---|---|---|
committer | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2023-02-05 12:35:27 +1100 |
commit | cc50ebf47b0cb4b19b68436037eff20d96874b3e (patch) | |
tree | a965b327906537454141a45ce6132a7d9d81d261 /src/api/routes/guilds | |
parent | Don't use relative path for db entities. Closes #937 (diff) | |
download | server-cc50ebf47b0cb4b19b68436037eff20d96874b3e.tar.xz |
Fix being unable to unset nicknames
Remove unwanted guild profile handler in cdn Fix rights check for bio/avatars of your own user
Diffstat (limited to 'src/api/routes/guilds')
-rw-r--r-- | src/api/routes/guilds/#guild_id/members/#member_id/index.ts | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/api/routes/guilds/#guild_id/members/#member_id/index.ts b/src/api/routes/guilds/#guild_id/members/#member_id/index.ts index d40f2772..6ac0dd3b 100644 --- a/src/api/routes/guilds/#guild_id/members/#member_id/index.ts +++ b/src/api/routes/guilds/#guild_id/members/#member_id/index.ts @@ -65,9 +65,19 @@ router.patch( if ("nick" in body) { permission.hasThrow("MANAGE_NICKNAMES"); + + if (!body.nick) { + delete body.nick; + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + //@ts-ignore shut up + member.nick = null; // remove the nickname + } } - if (("bio" in body || "avatar" in body) && member_id != "@me") { + if ( + ("bio" in body || "avatar" in body) && + req.params.member_id != "@me" + ) { const rights = await getRights(req.user_id); rights.hasThrow("MANAGE_USERS"); } |