Skip to content

Commit

Permalink
Revert "Dev to Main Sync" (#2166)
Browse files Browse the repository at this point in the history
Co-authored-by: Vinit khandal <[email protected]>
  • Loading branch information
iamitprakash and vinit717 authored Sep 17, 2024
1 parent 524bc4c commit ac2eb4b
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions models/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -911,13 +911,7 @@ const updateUsernamesInBatch = async (usersData) => {
};

usersData.forEach((user) => {
const updateUserData = {
...user,
username: user.username,
first_name: user.first_name.toLowerCase(),
last_name: user.last_name.toLowerCase(),
};

const updateUserData = { ...user, username: user.username };
batch.update(userModel.doc(user.id), updateUserData);
usersBatch.push(user.id);
});
Expand Down Expand Up @@ -985,13 +979,9 @@ const updateUsersWithNewUsernames = async () => {
const suffix = index + 1;
const formattedUsername = formatUsername(user.userData.first_name, user.userData.last_name, suffix);

usersToUpdate.push({
...user.userData,
id: user.id,
username: formattedUsername,
first_name: user.userData.first_name.toLowerCase(),
last_name: user.userData.last_name.toLowerCase(),
});
if (user.userData.username !== formattedUsername) {
usersToUpdate.push({ ...user.userData, id: user.id, username: formattedUsername });
}
});
}

Expand Down

0 comments on commit ac2eb4b

Please sign in to comment.