Skip to content

Commit

Permalink
πŸ› commit 수둜 필터링이 λ˜μ§€ μ•ŠλŠ” 버그 μˆ˜μ •
Browse files Browse the repository at this point in the history
  • Loading branch information
ChanHoLee275 committed Sep 24, 2021
1 parent e421144 commit 07ac61b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions backend/src/services/mail/mailAutoSender.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const Team = require("../../models/team");
const User = require("../../models/user");
const fetch = require('node-fetch');
const { getCommitCountOfTeam } = require("../github");
const nodemailer = require('nodemailer');

Expand All @@ -22,7 +21,7 @@ const getUsersCommits = async (teamIds) => {
const commits = await getCommitCountOfTeam(teamIds[i]);
users.concat(commits);
}
return users;
return users.filter(el => parseInt(el.commit) === 0).map(el => el.userId);
}
catch(err){
console.error(err);
Expand All @@ -34,7 +33,7 @@ const getUsersEmail = async (users) => {

const userIds = [];
for(let i = 0; i < users.length; i++){
const user = User.find({githubId:`${users[i]}`});
const user = await User.find({githubId:`${users[i]}`});
userIds.push(user.email);
};
return userIds;
Expand Down

0 comments on commit 07ac61b

Please sign in to comment.