mirror of
https://github.com/spacebarchat/server.git
synced 2024-11-08 11:52:55 +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;
|
if (body.require_colons == null) body.require_colons = true;
|
||||||
|
|
||||||
const user = await User.findOneOrFail({ where: { id: req.user_id } });
|
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 mimeType = body.image.split(":")[1].split(";")[0];
|
||||||
const emoji = await Emoji.create({
|
const emoji = await Emoji.create({
|
||||||
id: id,
|
id: id,
|
||||||
guild_id: guild_id,
|
guild_id: guild_id,
|
||||||
...body,
|
name: body.name,
|
||||||
require_colons: body.require_colons ?? undefined, // schema allows nulls, db does not
|
require_colons: body.require_colons ?? undefined, // schema allows nulls, db does not
|
||||||
user: user,
|
user: user,
|
||||||
managed: false,
|
managed: false,
|
||||||
|
Loading…
Reference in New Issue
Block a user