diff options
author | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2022-12-31 16:37:21 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-31 16:37:21 +1100 |
commit | 67658540d7ec65bc0e4a95388281b6c2211a7689 (patch) | |
tree | 316c66db0701cc24f36de7e38061635eb9f4fa9e | |
parent | Merge pull request #910 from Puyodead1/patch1 (diff) | |
parent | Merge branch 'staging' into patch/roles (diff) | |
download | server-67658540d7ec65bc0e4a95388281b6c2211a7689.tar.xz |
Merge pull request #906 from Puyodead1/patch/roles legacy-2
fix adding roles to users
-rw-r--r-- | src/api/routes/guilds/#guild_id/members/#member_id/index.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/api/routes/guilds/#guild_id/members/#member_id/index.ts b/src/api/routes/guilds/#guild_id/members/#member_id/index.ts index 06474f3e..8fe7d7dc 100644 --- a/src/api/routes/guilds/#guild_id/members/#member_id/index.ts +++ b/src/api/routes/guilds/#guild_id/members/#member_id/index.ts @@ -39,7 +39,8 @@ router.patch("/", route({ body: "MemberChangeSchema" }), async (req: Request, re permission.hasThrow("MANAGE_ROLES"); if (body.roles.indexOf(everyone.id) === -1) body.roles.push(everyone.id); - member.roles = body.roles.map((x) => OrmUtils.mergeDeep(new Role(), { id: x })); // foreign key constraint will fail if role doesn't exist + // member.roles = body.roles.map((x) => OrmUtils.mergeDeep(new Role(), { id: x })); // foreign key constraint will fail if role doesn't exist + body.roles = body.roles.map((x) => OrmUtils.mergeDeep(new Role(), { id: x })); } if (body.avatar) body.avatar = await handleFile(`/guilds/${guild_id}/users/${member_id}/avatars`, body.avatar as string); |