summary refs log tree commit diff
path: root/src/api/routes/v9/users
diff options
context:
space:
mode:
authorTheArcaneBrony <myrainbowdash949@gmail.com>2023-01-14 13:33:24 +0100
committerTheArcaneBrony <myrainbowdash949@gmail.com>2023-01-14 13:33:24 +0100
commit32b93c857f89283f276be5ae2e39c9d11c87fece (patch)
treedf7b4bcd0f375d06f2d5d4333f491680a0973cb6 /src/api/routes/v9/users
parentMove isTextChannel to channel (diff)
downloadserver-32b93c857f89283f276be5ae2e39c9d11c87fece.tar.xz
var -> let
Signed-off-by: TheArcaneBrony <myrainbowdash949@gmail.com>
Diffstat (limited to 'src/api/routes/v9/users')
-rw-r--r--src/api/routes/v9/users/#id/profile.ts4
-rw-r--r--src/api/routes/v9/users/#id/relationships.ts4
-rw-r--r--src/api/routes/v9/users/@me/guilds/#guild_id/settings.ts2
-rw-r--r--src/api/routes/v9/users/@me/index.ts4
-rw-r--r--src/api/routes/v9/users/@me/mfa/codes-verification.ts2
-rw-r--r--src/api/routes/v9/users/@me/mfa/codes.ts2
-rw-r--r--src/api/routes/v9/users/@me/relationships.ts6
7 files changed, 12 insertions, 12 deletions
diff --git a/src/api/routes/v9/users/#id/profile.ts b/src/api/routes/v9/users/#id/profile.ts
index 5c649056..1e28430c 100644
--- a/src/api/routes/v9/users/#id/profile.ts
+++ b/src/api/routes/v9/users/#id/profile.ts
@@ -35,8 +35,8 @@ router.get(
 			relations: ["connected_accounts"],
 		});
 
-		var mutual_guilds: object[] = [];
-		var premium_guild_since;
+		let mutual_guilds: object[] = [];
+		let premium_guild_since;
 
 		if (with_mutual_guilds == "true") {
 			const requested_member = await Member.find({
diff --git a/src/api/routes/v9/users/#id/relationships.ts b/src/api/routes/v9/users/#id/relationships.ts
index c6480567..8bfa2ca1 100644
--- a/src/api/routes/v9/users/#id/relationships.ts
+++ b/src/api/routes/v9/users/#id/relationships.ts
@@ -18,7 +18,7 @@ router.get(
 	"/",
 	route({ test: { response: { body: "UserRelationsResponse" } } }),
 	async (req: Request, res: Response) => {
-		var mutual_relations: object[] = [];
+		let mutual_relations: object[] = [];
 		const requested_relations = await User.findOneOrFail({
 			where: { id: req.params.id },
 			relations: ["relationships"],
@@ -35,7 +35,7 @@ router.get(
 					rmem.type === 1 &&
 					rmem.to_id !== req.user_id
 				) {
-					var relation_user = await User.getPublicUser(rmem.to_id);
+					let relation_user = await User.getPublicUser(rmem.to_id);
 
 					mutual_relations.push({
 						id: relation_user.id,
diff --git a/src/api/routes/v9/users/@me/guilds/#guild_id/settings.ts b/src/api/routes/v9/users/@me/guilds/#guild_id/settings.ts
index 436261d4..d84edb41 100644
--- a/src/api/routes/v9/users/@me/guilds/#guild_id/settings.ts
+++ b/src/api/routes/v9/users/@me/guilds/#guild_id/settings.ts
@@ -25,7 +25,7 @@ router.patch(
 		const body = req.body as UserGuildSettingsSchema;
 
 		if (body.channel_overrides) {
-			for (var channel in body.channel_overrides) {
+			for (let channel in body.channel_overrides) {
 				Channel.findOneOrFail({ where: { id: channel } });
 			}
 		}
diff --git a/src/api/routes/v9/users/@me/index.ts b/src/api/routes/v9/users/@me/index.ts
index 37356d9d..42c820f8 100644
--- a/src/api/routes/v9/users/@me/index.ts
+++ b/src/api/routes/v9/users/@me/index.ts
@@ -37,7 +37,7 @@ router.patch(
 		});
 
 		// Populated on password change
-		var newToken: string | undefined;
+		let newToken: string | undefined;
 
 		if (body.avatar)
 			body.avatar = await handleFile(
@@ -102,7 +102,7 @@ router.patch(
 		}
 
 		if (body.username) {
-			var check_username = body?.username?.replace(/\s/g, "");
+			let check_username = body?.username?.replace(/\s/g, "");
 			if (!check_username) {
 				throw FieldErrors({
 					username: {
diff --git a/src/api/routes/v9/users/@me/mfa/codes-verification.ts b/src/api/routes/v9/users/@me/mfa/codes-verification.ts
index 3411605b..e278c5ec 100644
--- a/src/api/routes/v9/users/@me/mfa/codes-verification.ts
+++ b/src/api/routes/v9/users/@me/mfa/codes-verification.ts
@@ -20,7 +20,7 @@ router.post(
 
 		const user = await User.findOneOrFail({ where: { id: req.user_id } });
 
-		var codes: BackupCode[];
+		let codes: BackupCode[];
 		if (regenerate) {
 			await BackupCode.update(
 				{ user: { id: req.user_id } },
diff --git a/src/api/routes/v9/users/@me/mfa/codes.ts b/src/api/routes/v9/users/@me/mfa/codes.ts
index 33053028..32f32772 100644
--- a/src/api/routes/v9/users/@me/mfa/codes.ts
+++ b/src/api/routes/v9/users/@me/mfa/codes.ts
@@ -33,7 +33,7 @@ router.post(
 			});
 		}
 
-		var codes: BackupCode[];
+		let codes: BackupCode[];
 		if (regenerate) {
 			await BackupCode.update(
 				{ user: { id: req.user_id } },
diff --git a/src/api/routes/v9/users/@me/relationships.ts b/src/api/routes/v9/users/@me/relationships.ts
index 3eec704b..6b5d429c 100644
--- a/src/api/routes/v9/users/@me/relationships.ts
+++ b/src/api/routes/v9/users/@me/relationships.ts
@@ -157,7 +157,7 @@ async function updateRelationship(
 		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,
 	);
@@ -201,13 +201,13 @@ async function updateRelationship(
 	if (user.relationships.length >= maxFriends)
 		throw DiscordApiErrors.MAXIMUM_FRIENDS.withParams(maxFriends);
 
-	var incoming_relationship = Relationship.create({
+	let incoming_relationship = Relationship.create({
 		nickname: undefined,
 		type: RelationshipType.incoming,
 		to: user,
 		from: friend,
 	});
-	var outgoing_relationship = Relationship.create({
+	let outgoing_relationship = Relationship.create({
 		nickname: undefined,
 		type: RelationshipType.outgoing,
 		to: friend,