summary refs log tree commit diff
path: root/api/src/routes
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-07-03 01:35:11 +1000
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-07-03 01:35:11 +1000
commit00593f5833e15d8df268e06d3731933542d64391 (patch)
treebd7701e19f3139eca95fa2770bcd54c7e6abdff0 /api/src/routes
parentMass invite perm (diff)
parentAllow nicknames through MemberChangeSchema (diff)
downloadserver-00593f5833e15d8df268e06d3731933542d64391.tar.xz
Merge branch 'fix/nicknames' into slowcord
Diffstat (limited to 'api/src/routes')
-rw-r--r--api/src/routes/guilds/#guild_id/members/#member_id/index.ts3
1 files changed, 3 insertions, 0 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 c285abb3..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
@@ -7,6 +7,7 @@ const router = Router();
 
 export interface MemberChangeSchema {
 	roles?: string[];
+	nick?: string;
 }
 
 router.get("/", route({}), async (req: Request, res: Response) => {
@@ -34,6 +35,8 @@ 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 (body.nick) member.nick = body.nick;
+
 	await member.save();
 
 	member.roles = member.roles.filter((x) => x.id !== everyone.id);