Skip to content

Conversation

@kangazoom
Copy link

TREK

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
What does it mean for code to be asynchronous? It means you can still interact with the page/app while it does other stuff like completing HTTP request cycles--you don't need to wait for the page to refresh each time.
Describe a piece of your code that executes asynchronously. How did this affect the way you structured it? In my code, we can send GET and POST requests (and wait for a response) all while using the page. I added messages to let the user know what's going on in case there is a delay so that they know something is happening.
What kind of errors might the API give you? How did you choose to handle them? The API could throw a 400 error, and I handled them by showing detailed error messages via axios' .catch feature. I also allow the user to update the form and try again.
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. Maybe since we could minimize the time it takes to search for a trip (thinking about time complexity). However, I don't think it would make sense to rely on the ordering in case a trip gets deleted (so if trip 17 is deleted, but we're looking for it based on order alone -- then we'd end up with trip 16 or something. womp womp).

@tildeee
Copy link

tildeee commented Dec 11, 2018

TREK

What We're Looking For

Feature Feedback
Core Requirements
Git hygiene x, GOOD COMMIT MESSAGES
Comprehension questions x
Functionality
Click a button to load and view a list of trips x
Click a trip to load and view trip details x
Fill out a form to reserve a spot x
Errors are reported to the user x
CSS is DRY and attractive, uses CSS Grid, flexbox, and/or Bootstrap x
Under the Hood
Trip data is retrieved using from the API x
JavaScript is well-organized and easy to read x
HTML is semantic x
Overall

Good work on this Michelle!

I have a concern about how you handled finding the current trip id, and that may be because of your absences that week. I'm leaving a few comments on it.

Otherwise, I think you did a great job with this project. Good work on it!

@@ -0,0 +1,152 @@
// --- RE-USABLE ---//
const baseURL = 'https://trektravel.herokuapp.com/trips/';
let id = 0;
Copy link

Choose a reason for hiding this comment

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

You're putting the id in this global scope in order to store what the current trip is... You should consider different approaches to get the value of id. Could you use a closure or read from the HTML? (details about this suggestion below)

// --- RE-USABLE ---//
const baseURL = 'https://trektravel.herokuapp.com/trips/';
let id = 0;
const post = '/reservations';
Copy link

Choose a reason for hiding this comment

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

This could probably have a better name

// });
};

// did you happen to click on a trip? have i got a trip for you!
Copy link

Choose a reason for hiding this comment

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

good comment ^^^^

};

// did you happen to click on a trip? have i got a trip for you!
$(`.trip-list *`).click(loadTripDetails);
Copy link

Choose a reason for hiding this comment

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

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