-
Notifications
You must be signed in to change notification settings - Fork 30
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
Luis add email notifcation to warning tracker backend #1123
Luis add email notifcation to warning tracker backend #1123
Conversation
…de to prevent post method from crashing
…d blue square is issued
… user data by creating an object
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.
Can confirm that the code works as intended, but there's some inconsistency between the API designs that can definitely be improved there.
|
||
const testWarning = checkIfSpecialCharacter(newWarning); | ||
if (testWarning) { | ||
return res.status(200).send({ |
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.
Errors shouldn't be returning a 200
code, a generic 400
should be enough. And why is errors returning two different bodies? ({ message: string }
and { error: string }
)
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.
Hello
Thanks for the feedback!
I send a 200 because if I send a 400 error, there is a red warning that appears in the console and wanted to avoid that. After reaching out team members this was the solution
Thank you all, merging! |
Description
Backend for sending an email,
Notable changes were, adding new functions to send the email, adjusted the filter method, and added helper functions to get the admin of the team .
Related PRS (if any):
To test this backend PR you need to checkout the #2752 frontend PR.
…
Main changes explained:
--created helper functions to send an email, but filtering and fetching the admin of the team.
--adjust filtering to check if an email should or shouldn't be sent
How to test:
npm run build && npm run start
Note:
Ensure you follow the steps of the Frontend PR and Ivy Chen's PR.