-
Notifications
You must be signed in to change notification settings - Fork 48
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
Sockets - Riyo #24
base: master
Are you sure you want to change the base?
Sockets - Riyo #24
Conversation
TREKWhat We're Looking For
|
}); | ||
}) | ||
.catch((error) => { | ||
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.
It would also be appropriate to have error.response
in your if statement to verify if there is a response object in error. Network errors won't have this.
<input type="submit" name="add-reservation" value="Reserve"/> | ||
</form>`) | ||
|
||
const reserve = createReservation(tripID); |
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.
Nice use of a closure.
</form>`) | ||
|
||
const reserve = createReservation(tripID); | ||
$('#trip-reservation-form').submit(reserve); |
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.
Shouldn't this be $('#reservation-form').submit
instead?
|
||
const reservationData = readFormData(); | ||
reportStatus('Sending reservation data...'); | ||
axios.post(tripAPI + tripID + "/reservations", 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.
You need a slash between tripAPI
and tripID
TREK
Congratulations! You're submitting your assignment!
Comprehension Questions
Trip
in 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.