ucsb-cs156-s21 / proj-ucsb-cs-las

https://proj-ucsb-cs-las.herokuapp.com/
MIT License
2 stars 3 forks source link

Do not allow two tutor entries with the same email address. #322

Open pconrad opened 3 years ago

pconrad commented 3 years ago

(1) Start by adding constraints at the database level if possible. (2) Then, improve error handling for the POST endpoint. The error should not just be a generic 500 but a 409 status with an error message that is specific (Tutor with email ___ already exists). (3) Ensure that the PUT endpoint doesn't allow changing the email address; a new email address should be a new tutor entry. (4) Then make the front end display a meaningful error message. Intercept the 409 and display a toast, for example.