Skip to content

Commit b2c933e

Browse files
committed
update response data for migrate function
1 parent 0dfda95 commit b2c933e

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

controllers/users.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -633,14 +633,11 @@ const migrate = async (req, res) => {
633633
countUserFound++;
634634
})
635635
.catch((error) => {
636+
countUserNotFound++;
637+
const invalidUsers = { userId, username, githubUsername };
638+
usersNotFound.push(invalidUsers);
636639
if (error.response && error.response.status === 404) {
637-
countUserNotFound++;
638-
const invalidUsers = {
639-
userId: `${userId}`,
640-
username: `${username}`,
641-
githubUsername: `${githubUsername}`,
642-
};
643-
usersNotFound.push(invalidUsers);
640+
logger.error("GitHub user not found", error);
644641
} else {
645642
logger.error("An error occurred at axios.get:", error);
646643
}

0 commit comments

Comments
 (0)