-
Notifications
You must be signed in to change notification settings - Fork 2
Contest winner through email #81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| const user = await User.findById(userID); | ||
| const receiver = await User.findById(receiverID); | ||
| if (!user || !receiver){ | ||
| return res.status(500).json({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update this to a 'Not found' status code
| } | ||
| const contest = await Contest.findById(contestID); | ||
| if (!contest){ | ||
| return res.status(500).json({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
| let success = false; | ||
| const { receiverID } = req.body; | ||
| try { | ||
| const user = await User.findById(userID); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the reason for searching up a 'user' here? If he doesn't exist, how would he have logged in? :)
rajivtitus
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Please address comments before meging
What this PR does (required):
Screenshots / Videos (required):
Any information needed to test this feature (required):
Any issues with the current functionality (optional):