-
Notifications
You must be signed in to change notification settings - Fork 47
LEANNE - NODES #43
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
base: master
Are you sure you want to change the base?
LEANNE - NODES #43
Conversation
TREKWhat We're Looking For
|
|
|
||
| axios.post(postURL, sendData) | ||
| .then((response) => { | ||
| clearForm; |
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.
This is a function reference, not a function call, so the form isn't getting cleared.
| axios.post(postURL, sendData) | ||
| .then((response) => { | ||
| clearForm; | ||
| reportStatus(`Successfully submitted reservation ${response.data.id}!`); |
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.
The reportStatus function isn't able to find the element it's looking for, so it looks like nothing happens when you try to book a trip.
| <li> ${data.id} </li> | ||
| <li> ${data.category} </li> | ||
| <li> ${data.weeks} </li> | ||
| <li> ${data.cost} </li> |
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.
Why isn't any of this data labeled?
| .catch((error) => { | ||
| console.log(error.response); | ||
| if (error.response.data && error.response.data.errors) { | ||
| reportStatus( |
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.
Again, report status isn't able to access an html element here, so nothing gets rendered.
| }; | ||
|
|
||
| const clearForm = () => { //clear out form after submission | ||
| $('form')[0].reset(); |
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.
this is a slick one-liner!
TREK
Congratulations! You're submitting your assignment!
Comprehension Questions
Tripin the list by it's ID field. Would it be advantageous to keep the list in order by the id field? Explain why or why not.