Check if role icon was actually sent or if it's just an empty string
This commit is contained in:
parent
19c7dfacc5
commit
3f59a5b529
@ -41,7 +41,7 @@ router.patch("/", route({ body: "RoleModifySchema", permission: "MANAGE_ROLES" }
|
|||||||
const { role_id, guild_id } = req.params;
|
const { role_id, guild_id } = req.params;
|
||||||
const body = req.body as RoleModifySchema;
|
const body = req.body as RoleModifySchema;
|
||||||
|
|
||||||
if (body.icon) body.icon = await handleFile(`/role-icons/${role_id}`, body.icon as string);
|
if (body.icon && body.icon.length) body.icon = await handleFile(`/role-icons/${role_id}`, body.icon as string);
|
||||||
else body.icon = undefined;
|
else body.icon = undefined;
|
||||||
|
|
||||||
const role = new Role({
|
const role = new Role({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user