-
Notifications
You must be signed in to change notification settings - Fork 48
Ports - Amy W #29
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?
Ports - Amy W #29
Conversation
TREKWhat We're Looking For
|
| } | ||
| }); | ||
| }; | ||
| $('#reservation-form').submit(createReservation); |
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.
Every time you click on trips, this attaches a new event handler to the form. This means if I click on a few trips a few times and then fill out and submit the form, several submit event handlers will fire and I'll get added to the trip multiple times.
Take a look at it in dev tools with the network tab open. You'll see the problem.
Instead you should clear all the event handlers from the form before attaching a new one.
| }) | ||
| .catch((error) => { | ||
| console.log(error.response); | ||
| if (error.response.data && error.response.data.errors) { |
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.
Nicely done
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.