Skip to content

Commit

Permalink
fix(cron): don't send email when no inactive users
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivo committed Apr 28, 2023
1 parent 7394fe9 commit c0ca8b7
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ export default async function sendEmail(
}
});

if (awaitingCount === 0) {
return res.status(200).json({ message: "no-awaiting" });
}

const admins = await prisma.user.findMany({
where: {
role: "ADMIN"
Expand Down

0 comments on commit c0ca8b7

Please sign in to comment.