issues
search
BuildForSDGCohort2
/
Team-030-Backend
Server side
0
stars
1
forks
source link
Team 030 backend arkson
#39
Closed
josiaharkson
closed
4 years ago
josiaharkson
commented
4 years ago
A register request body validation middleware added. To validate the
firstName
lastName
email
and
userType
fields from the request body.
Checks if the above fields are empty, and returns a specific error response message.
Checks if the
email
is valid
Checks if the
email
already exists or has already been registered
Checks if the
userType
matches enumerated user types ("cons", "ret", "farm", "inv", "who", "trans")
Converts the
email
field to lowercase (since the DB does not control letter casing)
Returns a specific explanatory error message if any field fails validation.
A register request body validation middleware added. To validate the
firstName
lastName
email
anduserType
fields from the request body.email
is validemail
already exists or has already been registereduserType
matches enumerated user types ("cons", "ret", "farm", "inv", "who", "trans")email
field to lowercase (since the DB does not control letter casing)