Skip to content

Conversation

@Peacegypsy
Copy link

TREK

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
What does it mean for code to be asynchronous? it means it can do more than one thing at a time.
Describe a piece of your code that executes asynchronously. How did this affect the way you structured it? my reserve trip form and trip details form both load when a single trip from the main trip list is clicked.
What kind of errors might the API give you? How did you choose to handle them? error messages. trips not found, misspellings, invalid fields etc.
Suppose you needed to routinely find a specific 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. one advantage i can think of is if the list is ordered by the ID, is that it could be a faster time complexity, but thats kind of all i can think of.

@CheezItMan
Copy link

TREK

What We're Looking For

Feature Feedback
Core Requirements
Git hygiene Good number of commits and good commit messages
Comprehension questions Check, Asynchronous actually means code can run in an indeterminate order, but it can seem to run two things at the same time. Why would it be faster to look up a trip if they're kept in order?
Functionality
Click a button to load and view a list of trips Check
Click a trip to load and view trip details Check
Fill out a form to reserve a spot Check
Errors are reported to the user Check, but not for reserving a trip, in that case it just crashes.
CSS is DRY and attractive, uses CSS Grid, flexbox, and/or Bootstrap Minimal styling, no use of Bootstrap
Under the Hood
Trip data is retrieved using from the API Check
JavaScript is well-organized and easy to read Check
HTML is semantic Lots of div elements, but not bad semantic HTML.
Optionals You attempted creating a trip, it's not working, but close
Overall Nice work, you hit all the learning goals, you even attempted creating a trip. Nice job. There are a few small bugs, in your error messaging, but overall this is good stuff!

const individualTrip = showTrip(trip.id);
vacation.click(individualTrip);
})
.catch(error => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have the catch after the forEach. Instead move the }) on line 45, up to before the .catch

You can see the error in your browser console

})
.catch(error => {
console.log(error.response);
if (error.response.data && error.response.data.errors) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the post doesn't work (network error), then there may be no error.response (it may be undefined).

This should be:
if (error.response && error.response.data && error.response.data.errors) {

})
.catch(error => {
console.log(error.response);
if (error.response.data && error.response.data.errors) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar issue to the above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants