Open
Conversation
…hen clicked. The button click makes a GET request and then each trip is added to a tr and displayed in the DOM.
…save point before I try having the trip list populate a ul instead of a table.
…n of function to make reservation. Need to bug fix.
…Added required keyword to HTML form to prevent unnecessary API calls. Added some comments on on items that still need attention.
…lso does not disappear.
… details to show - currently undefined. Still working on this.
…ed up a few comments.
…calls if Show All Trips button is clicked again.
…w. The form starts as hidden and will not flash during initial page load.
Made the same change on both branches.
… small refactor to remove a variable that seemed not-so-useful.
TREKWhat We're Looking For
|
CheezItMan
reviewed
Jun 10, 2019
| $("#trip-details").append(`<p><span class="bold">Summary:</span><br> ${trip.about}</p>`); | ||
| $("#trip-details").append(`<p><span class="bold">Price:</span> $${trip.cost.toFixed(2)}</p>`); | ||
|
|
||
| $('#reservation-form').unbind('submit'); |
There was a problem hiding this comment.
Very good idea to use unbind to remove other event handlers from the form.
|
|
||
| $(`#${trip.id}`).unbind() | ||
| $(`#${trip.id}`).bind('click', {thisTrip:trip}, function(event){ | ||
| // Chris: I realized when I was just about done with this project that .bind() is deprecated. D: This should be changed to a .on() method instead. I will refactor if I get some more time, or perhaps we could talk through it. |
There was a problem hiding this comment.
Yup, this still works fine, the better way is to use .on like we did in class.
| if (error.response.data && error.response.data.errors) { | ||
| reportStatus(`${customMessage} Details: ${error.message}, ${error.response.data.errors}`); | ||
| } else { | ||
| reportStatus(`${customMessage} Details: ${error.message}`); |
There was a problem hiding this comment.
You should respond by also reporting any validation errors. You can loop through the content like we did in Rails.
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.
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.