mirror of
https://github.com/spacebarchat/server.git
synced 2024-11-10 12:42:44 +01:00
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 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;
|
||||
|
||||
const role = new Role({
|
||||
|
Loading…
Reference in New Issue
Block a user