mirror of
https://github.com/spacebarchat/server.git
synced 2024-11-25 11:43:07 +01:00
Fix uploading of emojis
This commit is contained in:
parent
143cbf2e98
commit
ff1ed0d744
@ -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