1
0
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:
Madeline 2022-07-10 22:06:26 +10:00
parent 90e0fc66c8
commit a0c198a56a
No known key found for this signature in database
GPG Key ID: 1958E017C36F2E47

View File

@ -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({