summary refs log tree commit diff
path: root/src/api/routes/users/#id/profile.ts
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2023-01-20 18:10:47 +1100
committerGitHub <noreply@github.com>2023-01-20 18:10:47 +1100
commit71082eb918f055f07fa45cd44c90fcb0c8dd6a29 (patch)
tree34fe911abebb5e954b1fd5de57d8ed00d7304121 /src/api/routes/users/#id/profile.ts
parentfix: route file regex (#956) (diff)
downloadserver-71082eb918f055f07fa45cd44c90fcb0c8dd6a29.tar.xz
Add ESLint (#941)
* Add eslint, switch to lint-staged for precommit

* Fix all ESLint errors

* Update GH workflow to check prettier and eslint
Diffstat (limited to 'src/api/routes/users/#id/profile.ts')
-rw-r--r--src/api/routes/users/#id/profile.ts9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/api/routes/users/#id/profile.ts b/src/api/routes/users/#id/profile.ts
index 1103bb48..dbf95a52 100644
--- a/src/api/routes/users/#id/profile.ts
+++ b/src/api/routes/users/#id/profile.ts
@@ -19,11 +19,9 @@
 import { Router, Request, Response } from "express";
 import {
 	PublicConnectedAccount,
-	PublicUser,
 	User,
 	UserPublic,
 	Member,
-	Guild,
 	UserProfileModifySchema,
 	handleFile,
 	PrivateUserProjection,
@@ -53,8 +51,8 @@ router.get(
 			relations: ["connected_accounts"],
 		});
 
-		var mutual_guilds: object[] = [];
-		var premium_guild_since;
+		const mutual_guilds: object[] = [];
+		let premium_guild_since;
 
 		if (with_mutual_guilds == "true") {
 			const requested_member = await Member.find({
@@ -169,7 +167,7 @@ router.patch(
 				`/banners/${req.user_id}`,
 				body.banner as string,
 			);
-		let user = await User.findOneOrFail({
+		const user = await User.findOneOrFail({
 			where: { id: req.user_id },
 			select: [...PrivateUserProjection, "data"],
 		});
@@ -177,6 +175,7 @@ router.patch(
 		user.assign(body);
 		await user.save();
 
+		// eslint-disable-next-line @typescript-eslint/ban-ts-comment
 		// @ts-ignore
 		delete user.data;