Conversation
| .then((response) => { | ||
| reportStatus(`Successfully loaded ${response.data.name} trip`); | ||
| console.log(response); | ||
| const result = response.data |
There was a problem hiding this comment.
It seems like on a simple variable assignment like this, you have a tendency to miss the semi-colon. Watch out for this!
| // console.log(reservation); | ||
| // console.log(trip); | ||
|
|
||
| const reservationData = { |
| </section> | ||
|
|
||
| <aside id="right-aside"> | ||
| <section id="hide"> |
There was a problem hiding this comment.
I would use a more semantic id for this that would better indicate what data this contains, even if the ultimate goal is to hide it
| $('form').submit( function(event) { | ||
| event.preventDefault(); | ||
| const reservation = this | ||
| console.log(trip); |
There was a problem hiding this comment.
It might be worthwhile to pull out only trip.id here because neither the tripDetails or createReservation functions are using anything other than the ID
| const reservation = this | ||
| console.log(trip); | ||
|
|
||
| createReservation(reservation, trip); |
There was a problem hiding this comment.
I like the way that you used different functions here to handle the tripDetails and the createReservation logic. This makes the nested event handlers (aka using closures) a bit easier to read.
TREKWhat We're Looking For
|
TREK
Congratulations! You're submitting your assignment!
Comprehension Questions