-
Notifications
You must be signed in to change notification settings - Fork 42
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
Amy Lee -- Carets #40
base: master
Are you sure you want to change the base?
Conversation
… GET allTrips event to the click button event; probably best to refactor this at some point
…rips' api request
…all trips depending on the buttons clicked using #.empty, page still unstyled
trip; added form and method to add new trip. styling and refactoring needed for both
…ctions unnecessary sections using .empty at this time
…r some functional code for optionals, to complete later
TREKWhat We're Looking For
For the comp Q on async: Not sure what the Overall good job with the project, glad you got to work on adding a new trip |
<button type="submitReservation">Add This Trip</button> | ||
</section> | ||
</form>`; | ||
$('#trip-list').prepend(newTripForm); |
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 particular form doesn't have any HTML that needs to be dynamically generated. Since the form will look the same in all cases, you may consider having this on the html already, and just using jQuery to hide()/show() it when appropriate
response.forEach((trip) => { | ||
const tripInfo = `<li data-id= ${trip.id} id = "trip-${trip.id}"><strong>${trip.name}</strong> - ${trip.weeks} week(s) in ${trip.continent} </li>`; | ||
$('#trip-list ul').append(tripInfo); | ||
if (!continents.includes(trip.continent.toLowerCase()) && trip.continent) { |
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.
if trip.continent
is null, the code breaks. Surprisingly enough, if you change the order of this conditional, then it'll work:
if (trip.continent && !continents.includes(trip.continent.toLowerCase())) {
In a conditional with an &&
, if trip.continent
is falsey, it won't bother evaluating the rest of the conditional
TREK
Congratulations! You're submitting your assignment!
Comprehension Questions