Skip to content

Philips response branch#23

Open
philipbaledia wants to merge 12 commits intodevfrom
philips_response_branch
Open

Philips response branch#23
philipbaledia wants to merge 12 commits intodevfrom
philips_response_branch

Conversation

@philipbaledia
Copy link
Contributor

No description provided.

@DChan0319 DChan0319 added the enhancement New feature or request label Aug 3, 2020
@DChan0319 DChan0319 linked an issue Aug 3, 2020 that may be closed by this pull request
4 tasks
@DChan0319 DChan0319 marked this pull request as ready for review August 3, 2020 18:06
const response = createSuccessfulResponse("post", req.body, token);
res.code(HTTP_CREATED).send(response);
} catch (err) {
const message = "Invalid Email or Password";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't a correct message. I mean usually if it's an invalid password or email we'd have to do some sort of validation to determine whether or not it is a password or not. Let's say a valid password is atleast 5 characters and it has to be alphanumeric. For an email you can use the regex here and validate an email against this: https://emailregex.com/ in javascript.

@@ -28,8 +28,12 @@ export async function userRoutes(server) {
const response = createSuccessfulResponse("post", req.body, token);
res.code(HTTP_CREATED).send(response);
} catch (err) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably want to see if we catch a query error exception if it is it's just an internal server error as the message. The actual code we can see what error postgresql gives us and pass that error code to the error and use that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Formalize our api responses.

3 participants