Skip to content

Conversation

@leannerivera
Copy link

TREK

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
What does it mean for code to be asynchronous? it waits until something happens first, waits for a promise to be returned
Describe a piece of your code that executes asynchronously. How did this affect the way you structured it? axios calls; didn't that is the way we learnt it
What kind of errors might the API give you? How did you choose to handle them? cannot find trip error, cannot make reservation error; error messaging via report status
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. no, because IDs can change.

@dHelmgren
Copy link

TREK

What We're Looking For

Feature Feedback
Core Requirements
Git hygiene Kinda fell off on your commit schedule there!
Comprehension questions Asynchronous code is more like code that doesn't execute linearly. We send off a call, but we keep doing what we were going to do after as if the code within has already run.
Functionality
Click a button to load and view a list of trips Yes
Click a trip to load and view trip details Yes
Fill out a form to reserve a spot No, see comments
Errors are reported to the user No
CSS is DRY and attractive, uses CSS Grid, flexbox, and/or Bootstrap Not much styling.
Under the Hood
Trip data is retrieved using from the API Yes
JavaScript is well-organized and easy to read Yes
HTML is semantic I think you've used section and article for inverse purposes, but that's okay.
Overall This submission works in a lot of technical ways, but it's let down by a lack of attention to detail. Not labeling data and not making sure that you displayed information to the user have all hurt the quality here.


axios.post(postURL, sendData)
.then((response) => {
clearForm;

Choose a reason for hiding this comment

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

This is a function reference, not a function call, so the form isn't getting cleared.

axios.post(postURL, sendData)
.then((response) => {
clearForm;
reportStatus(`Successfully submitted reservation ${response.data.id}!`);

Choose a reason for hiding this comment

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

The reportStatus function isn't able to find the element it's looking for, so it looks like nothing happens when you try to book a trip.

<li> ${data.id} </li>
<li> ${data.category} </li>
<li> ${data.weeks} </li>
<li> ${data.cost} </li>

Choose a reason for hiding this comment

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

Why isn't any of this data labeled?

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

Choose a reason for hiding this comment

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

Again, report status isn't able to access an html element here, so nothing gets rendered.

};

const clearForm = () => { //clear out form after submission
$('form')[0].reset();

Choose a reason for hiding this comment

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

this is a slick one-liner!

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