Open
Conversation
4 tasks
DChan0319
reviewed
Aug 3, 2020
DChan0319
reviewed
Aug 3, 2020
DChan0319
reviewed
Aug 3, 2020
DChan0319
reviewed
Aug 3, 2020
DChan0319
reviewed
Aug 3, 2020
DChan0319
reviewed
Aug 3, 2020
…dded newline character to response.js
jontkoh
reviewed
Aug 4, 2020
jontkoh
approved these changes
Aug 4, 2020
…andle successful requests
DChan0319
requested changes
Aug 4, 2020
DChan0319
requested changes
Aug 4, 2020
DChan0319
requested changes
Aug 13, 2020
src/routes/user/index.js
Outdated
| const response = createSuccessfulResponse("post", req.body, token); | ||
| res.code(HTTP_CREATED).send(response); | ||
| } catch (err) { | ||
| const message = "Invalid Email or Password"; |
Contributor
There was a problem hiding this comment.
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) { | |||
Contributor
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.