summary refs log tree commit diff
path: root/api/src/routes
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-10-10 19:02:08 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-10-10 19:02:08 +0200
commit3c4764fbc84fc4f8781e0575d1cf52f3d8ae3f7a (patch)
tree80fc26253e4502c6cf627e812fe8a862a12fc972 /api/src/routes
parentMerge branch 'master' into remove-vanity-url (diff)
parent:bug: fix modify role.permissions (diff)
downloadserver-3c4764fbc84fc4f8781e0575d1cf52f3d8ae3f7a.tar.xz
Merge branch 'master' into pr/TheArcaneBrony/434
Diffstat (limited to 'api/src/routes')
-rw-r--r--api/src/routes/guilds/#guild_id/roles.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/api/src/routes/guilds/#guild_id/roles.ts b/api/src/routes/guilds/#guild_id/roles.ts
index 0a57c6a2..b1875598 100644
--- a/api/src/routes/guilds/#guild_id/roles.ts
+++ b/api/src/routes/guilds/#guild_id/roles.ts
@@ -17,7 +17,7 @@ const router: Router = Router();
 
 export interface RoleModifySchema {
 	name?: string;
-	permissions?: bigint;
+	permissions?: string;
 	color?: number;
 	hoist?: boolean; // whether the role should be displayed separately in the sidebar
 	mentionable?: boolean; // whether the role should be mentionable
@@ -57,7 +57,7 @@ router.post("/", route({ body: "RoleModifySchema", permission: "MANAGE_ROLES" })
 		...body,
 		guild_id: guild_id,
 		managed: false,
-		permissions: String(req.permission!.bitfield & (body.permissions || BigInt("0"))),
+		permissions: String(req.permission!.bitfield & BigInt(body.permissions || "0")),
 		tags: undefined
 	});
 
@@ -109,7 +109,7 @@ router.patch("/:role_id", route({ body: "RoleModifySchema", permission: "MANAGE_
 		...body,
 		id: role_id,
 		guild_id,
-		permissions: String(req.permission!.bitfield & (body.permissions || BigInt("0")))
+		permissions: String(req.permission!.bitfield & BigInt(body.permissions || "0"))
 	});
 
 	await Promise.all([