-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
validate team code #31
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⭐
const results = await knex('Teams').where({ team_code: teamCode }); | ||
|
||
if (results.length === 0) { | ||
throw new Error('Team not found'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps would be better to not throw an error, but to send a response with 404 code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw this, but I mean in terms of the API, it is perhaps not the best to throw an error here, because and error did not happen.
"The HTTP 404 Not Found response status code indicates that the server cannot find the requested resource."
…etroRealm into implementIndexPage
const results = await knex('Teams').where({ team_code: teamCode }); | ||
|
||
if (results.length === 0) { | ||
throw new Error('Team not found'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw this, but I mean in terms of the API, it is perhaps not the best to throw an error here, because and error did not happen.
"The HTTP 404 Not Found response status code indicates that the server cannot find the requested resource."
Description
implemented team code validation
Fixes # (issue)
How to test?
Please provide a short summary how your changes can be tested?
Checklist