diff options
author | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2023-01-20 18:10:47 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-20 18:10:47 +1100 |
commit | 71082eb918f055f07fa45cd44c90fcb0c8dd6a29 (patch) | |
tree | 34fe911abebb5e954b1fd5de57d8ed00d7304121 /src/api/routes/users/#id/profile.ts | |
parent | fix: route file regex (#956) (diff) | |
download | server-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.ts | 9 |
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; |