From ff1ed0d744096aaa15efe790c842d544c5b78354 Mon Sep 17 00:00:00 2001 From: TomatoCake <60300461+DEVTomatoCake@users.noreply.github.com> Date: Mon, 2 Sep 2024 19:39:32 +0200 Subject: [PATCH] Fix uploading of emojis --- src/api/routes/guilds/#guild_id/emojis.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/routes/guilds/#guild_id/emojis.ts b/src/api/routes/guilds/#guild_id/emojis.ts index f3f0fd8b..22eac91a 100644 --- a/src/api/routes/guilds/#guild_id/emojis.ts +++ b/src/api/routes/guilds/#guild_id/emojis.ts @@ -123,13 +123,13 @@ router.post( if (body.require_colons == null) body.require_colons = true; const user = await User.findOneOrFail({ where: { id: req.user_id } }); - body.image = (await handleFile(`/emojis/${id}`, body.image)) as string; + await handleFile(`/emojis/${id}`, body.image); const mimeType = body.image.split(":")[1].split(";")[0]; const emoji = await Emoji.create({ id: id, guild_id: guild_id, - ...body, + name: body.name, require_colons: body.require_colons ?? undefined, // schema allows nulls, db does not user: user, managed: false,