-
Notifications
You must be signed in to change notification settings - Fork 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
Jamila Octos C9 #29
base: master
Are you sure you want to change the base?
Jamila Octos C9 #29
Conversation
.then((response) => { | ||
reportStatus(`Successfully loaded ${response.data.name} trip`); | ||
console.log(response); | ||
const result = response.data |
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.
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 = { |
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.
Good
</section> | ||
|
||
<aside id="right-aside"> | ||
<section id="hide"> |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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