summary refs log tree commit diff
path: root/api
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
parent:bug: fix sticker packs (diff)
downloadserver-88425f87ecdc5e0d8e64a8e0ce44fea19daf4652.tar.xz
:art: reformat
Diffstat (limited to 'api')
-rw-r--r--api/src/Server.ts2
-rw-r--r--api/src/routes/guilds/#guild_id/emojis.ts5
-rw-r--r--api/tsconfig.json3
3 files changed, 3 insertions, 7 deletions
diff --git a/api/src/Server.ts b/api/src/Server.ts
index 1f11a295..a6887fd4 100644
--- a/api/src/Server.ts
+++ b/api/src/Server.ts
@@ -78,7 +78,7 @@ export class FosscordServer extends Server {
 		api.use("*", (error: any, req: Request, res: Response, next: NextFunction) => {
 			if (error) return next(error);
 			res.status(404).json({
-				message: "404: Not Found",
+				message: "404 endpoint not found",
 				code: 0
 			});
 			next();
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({
diff --git a/api/tsconfig.json b/api/tsconfig.json
index 2cf4e4c1..80d7251f 100644
--- a/api/tsconfig.json
+++ b/api/tsconfig.json
@@ -67,8 +67,7 @@
 		"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */,
 		"baseUrl": ".",
 		"paths": {
-			"@fosscord/api": ["src/index"],
-			"@fosscord/api/*": ["src/*"]
+			"@fosscord/api": ["src/index"]
 		},
 		"plugins": [{ "transform": "@zerollup/ts-transform-paths" }],
 		"experimentalDecorators": true