1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-22 10:22:39 +01:00

Fix uploading of emojis

This commit is contained in:
TomatoCake 2024-09-02 19:39:32 +02:00
parent 143cbf2e98
commit ff1ed0d744

View File

@ -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,