summary refs log tree commit diff
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-07-03 01:51:23 +1000
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-07-03 01:51:23 +1000
commitfcf879980de833ffa9f358bdd932284698591fe0 (patch)
treeb0504c6d7ea2afb7422ab2ecda1f8bbb9264eb54
parentMerge branch 'fix/nicknames' into slowcord (diff)
parentRevert "Perhaps a better nickname change implementation" (diff)
downloadserver-fcf879980de833ffa9f358bdd932284698591fe0.tar.xz
Merge branch 'fix/nicknames' into slowcord
-rw-r--r--api/src/routes/guilds/#guild_id/members/#member_id/index.ts5
1 files changed, 1 insertions, 4 deletions
diff --git a/api/src/routes/guilds/#guild_id/members/#member_id/index.ts b/api/src/routes/guilds/#guild_id/members/#member_id/index.ts
index 9b6465f6..2ff89eae 100644
--- a/api/src/routes/guilds/#guild_id/members/#member_id/index.ts
+++ b/api/src/routes/guilds/#guild_id/members/#member_id/index.ts
@@ -35,10 +35,7 @@ router.patch("/", route({ body: "MemberChangeSchema" }), async (req: Request, re
 		member.roles = body.roles.map((x) => new Role({ id: x })); // foreign key constraint will fail if role doesn't exist
 	}
 
-	if ('nick' in body) {
-		permission.hasThrow("CHANGE_NICKNAME");
-		Member.changeNickname(member.id, member.guild.id, body.nick!);
-	}
+	if (body.nick) member.nick = body.nick;
 
 	await member.save();