diff options
author | TheArcaneBrony <myrainbowdash949@gmail.com> | 2022-07-18 18:30:53 +0200 |
---|---|---|
committer | TheArcaneBrony <myrainbowdash949@gmail.com> | 2022-08-09 23:28:27 +0200 |
commit | e536fb2f72e4883979b451b60b12c44f5f94313c (patch) | |
tree | 9c7fccb12c5aeec560d3c223a3b6e969e8d95cd9 /api/src/routes/users/@me/relationships.ts | |
parent | Update User.ts (diff) | |
download | server-e536fb2f72e4883979b451b60b12c44f5f94313c.tar.xz |
replace all var with let (reduces warnings)
Diffstat (limited to 'api/src/routes/users/@me/relationships.ts')
-rw-r--r-- | api/src/routes/users/@me/relationships.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/api/src/routes/users/@me/relationships.ts b/api/src/routes/users/@me/relationships.ts index 0c13cdba..d03014b6 100644 --- a/api/src/routes/users/@me/relationships.ts +++ b/api/src/routes/users/@me/relationships.ts @@ -129,7 +129,7 @@ async function updateRelationship(req: Request, res: Response, friend: User, typ { relations: ["relationships", "relationships.to"], select: userProjection } ); - var relationship = user.relationships.find((x) => x.to_id === id); + let relationship = user.relationships.find((x) => x.to_id === id); const friendRequest = friend.relationships.find((x) => x.to_id === req.user_id); // TODO: you can add infinitely many blocked users (should this be prevented?) @@ -165,8 +165,8 @@ async function updateRelationship(req: Request, res: Response, friend: User, typ const { maxFriends } = Config.get().limits.user; if (user.relationships.length >= maxFriends) throw DiscordApiErrors.MAXIMUM_FRIENDS.withParams(maxFriends); - var incoming_relationship = new Relationship({ nickname: undefined, type: RelationshipType.incoming, to: user, from: friend }); - var outgoing_relationship = new Relationship({ + let incoming_relationship = new Relationship({ nickname: undefined, type: RelationshipType.incoming, to: user, from: friend }); + let outgoing_relationship = new Relationship({ nickname: undefined, type: RelationshipType.outgoing, to: friend, |