summary refs log tree commit diff
path: root/api/src/routes/guilds/#guild_id/members
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-09-03 05:03:11 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-09-03 05:03:11 +0200
commite2ea701920f528b09c410842fcfe57ec3e3ba875 (patch)
tree429a4a3426730aa2649356b4f91cb720561e0709 /api/src/routes/guilds/#guild_id/members
parent:see_no_evil: add database.db to .gitignore (diff)
downloadserver-e2ea701920f528b09c410842fcfe57ec3e3ba875.tar.xz
:sparkles: guild position update
Diffstat (limited to 'api/src/routes/guilds/#guild_id/members')
-rw-r--r--api/src/routes/guilds/#guild_id/members/#member_id/index.ts4
1 files changed, 2 insertions, 2 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 8b74a524..aef1c6dc 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
@@ -33,10 +33,10 @@ router.patch("/", check(MemberChangeSchema), async (req: Request, res: Response)
 	const permission = await getPermission(req.user_id, guild_id);
 
 	if (body.roles) {
+		permission.hasThrow("MANAGE_ROLES");
+
 		const roles = await Role.find({ id: In(body.roles) });
 		if (body.roles.length !== roles.length) throw new HTTPError("Roles not found", 404);
-
-		permission.hasThrow("MANAGE_ROLES");
 	}
 
 	const member = await Member.findOneOrFail({ id: member_id, guild_id });