mirror of
https://github.com/spacebarchat/server.git
synced 2024-11-05 02:12:28 +01:00
Merge pull request #1209 from DEVTomatoCake/fix/emoji-creation
Fix uploading of emojis
This commit is contained in:
commit
64c233b84c
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user