diff options
Diffstat (limited to 'src/api/routes/guilds/#guild_id/roles/index.ts')
-rw-r--r-- | src/api/routes/guilds/#guild_id/roles/index.ts | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/api/routes/guilds/#guild_id/roles/index.ts b/src/api/routes/guilds/#guild_id/roles/index.ts index 534a5967..4cd47cf3 100644 --- a/src/api/routes/guilds/#guild_id/roles/index.ts +++ b/src/api/routes/guilds/#guild_id/roles/index.ts @@ -61,9 +61,13 @@ router.post( await Promise.all([ role.save(), // Move all existing roles up one position, to accommodate the new role - Role.createQueryBuilder('roles') - .where({ guild: { id: guild_id }, name: Not("@everyone"), id: Not(role.id) }) - .update({ position: () => 'position + 1' }) + Role.createQueryBuilder("roles") + .where({ + guild: { id: guild_id }, + name: Not("@everyone"), + id: Not(role.id), + }) + .update({ position: () => "position + 1" }) .execute(), emitEvent({ event: "GUILD_ROLE_CREATE", |