TomDoesTech / REST-API-Tutorial-Updated

https://www.youtube.com/watch?v=BWUi6BS9T5Y
574 stars 283 forks source link

Update user.service.ts #17

Closed ibukunfolay closed 1 year ago

ibukunfolay commented 1 year ago

Updated the service to check if email is already in use before creating user

tomanagle commented 1 year ago

Why would you want to do this? The DB should be responsible for enforcing the uniqueness of emails

ibukunfolay commented 1 year ago

I believe the db does. howeverno specific error is thrown to let an unsuspecting user know what the problem is. hence, the error message.