Fix uploading of emojis

This commit is contained in:
Toastie 2024-09-26 21:01:24 +12:00
parent fde638a810
commit 5e46583f84
Signed by: toastie_t0ast
GPG key ID: 27F3B6855AFD40A4

View file

@ -105,13 +105,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,