summary refs log tree commit diff
path: root/api/src/routes
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-10-15 00:03:35 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-10-15 00:03:35 +0200
commit88425f87ecdc5e0d8e64a8e0ce44fea19daf4652 (patch)
treec81daa5711491f74d6b0a51767640132ee0a009d /api/src/routes
parent:bug: fix sticker packs (diff)
downloadserver-88425f87ecdc5e0d8e64a8e0ce44fea19daf4652.tar.xz
:art: reformat
Diffstat (limited to 'api/src/routes')
-rw-r--r--api/src/routes/guilds/#guild_id/emojis.ts5
1 files changed, 1 insertions, 4 deletions
diff --git a/api/src/routes/guilds/#guild_id/emojis.ts b/api/src/routes/guilds/#guild_id/emojis.ts
index ff565cd4..85d7ac05 100644
--- a/api/src/routes/guilds/#guild_id/emojis.ts
+++ b/api/src/routes/guilds/#guild_id/emojis.ts
@@ -40,17 +40,14 @@ router.post("/", route({ body: "EmojiCreateSchema", permission: "MANAGE_EMOJIS_A
 	const { guild_id } = req.params;
 	const body = req.body as EmojiCreateSchema;
 
+	const id = Snowflake.generate();
 	const emoji_count = await Emoji.count({ guild_id: guild_id });
 	const { maxEmojis } = Config.get().limits.guild;
 
 	if (emoji_count >= maxEmojis) throw DiscordApiErrors.MAXIMUM_NUMBER_OF_EMOJIS_REACHED.withParams(maxEmojis);
-
-	const id = Snowflake.generate();
-
 	if (body.require_colons == null) body.require_colons = true;
 
 	const user = await User.findOneOrFail({ id: req.user_id });
-
 	body.image = (await handleFile(`/emojis/${id}`, body.image)) as string;
 
 	const emoji = await new Emoji({