Skip to content
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

Jazz Trek #19

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Jazz Trek #19

wants to merge 6 commits into from

Conversation

jazziesf
Copy link

TREK

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
What does it mean for code to be asynchronous? Work runs separately from the main application and notifies the calling thread of its completion, failure or progress. I had to look it up again because I am not entirely sure what it means yet.
Describe a piece of your code that executes asynchronously. How did this affect the way you structured it? The only example I can think of is waiting for the document to fully load before executing the code.
What kind of errors might the API give you? How did you choose to handle them? I used error response to tell the user what the issues are. Although I feel like there could have been better ways to handle them.
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. That would be a design decision. I would create a search to find a trip by its ID rather than keep them in order. You might want to order them by popularity, cost, or other factors. Finding the ID could be just an easy if you have an ID search.

@CheezItMan
Copy link

TREK

What We're Looking For

Feature Feedback
Core Requirements
Git hygiene Focus on functionality added, not waves completed in commit messages.
Comprehension questions Your get and post requests were also asynchronous because it takes time while the API call runs and the callback functions are invoked at an undetermined time after the API call is made.
Functionality
Click a button to load and view a list of trips Check
Click a trip to load and view trip details Check, but even if the network request fails, the white container element shows up empty. I would hide that block on a failed request.
Fill out a form to reserve a spot Check
Errors are reported to the user no errors reported on a failed post request to reserve a trip, if the network request fails. Otherwise good.
CSS is DRY and attractive, uses CSS Grid, flexbox, and/or Bootstrap Reasonably attractive, note the background image has both light and dark areas and so it obscures some of the dark text. I suggest lowering the background images opacity. You also have some repeated CSS rules (minor note)
Under the Hood
Trip data is retrieved using from the API Check
JavaScript is well-organized and easy to read Check
HTML is semantic Check
Overall Nicely done, you hit all the learning goals. I had some minor suggestions, but your code does everything we expected. Well done with the toggling of CSS classes and handling of errors. Let me know if you have any questions.

})
.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.

You should also test error.response



$("#load").on("click", loadTrips, function() {
$('#trip-list').toggle();

Choose a reason for hiding this comment

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

I suggest only toggling #trip-list if the API request is successful.

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