Skip to content

Conversation

@goeunpark
Copy link

TREK

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
What does it mean for code to be asynchronous? asynchronos code can do many thing at once (like load up many different things in a page without refreshing) and will execute at some point in the future, likely triggered by some external event such as being clicked
Describe a piece of your code that executes asynchronously. How did this affect the way you structured it? when user clicks a button to load trips, this triggers a function that loads up all trips
What kind of errors might the API give you? How did you choose to handle them? reportStatus and reportError functions should help me parse out why I have errors
Suppose you needed to routinely find a specific Trip in the list by its ID field. Would it be advantageous to keep the list in order by the id field? Explain why or why not. yes because then its trip_id can be the same as its index in the array and can be easily indexed

@CheezItMan
Copy link

TREK

What We're Looking For

Feature Feedback
Core Requirements
Git hygiene Good number of commits but avoid mentioning the waves in your commit messages, instead describe the functionality that's been added.
Comprehension questions Check, but one of the questions was what type of errors might an API return. An example might be, validation errors from the post request, or a network error if the API or wifi is down.
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 Missing, the form makes a request, but the trip ID is not sent properly or filled in in the form.
Errors are reported to the user Missing No errors reported!
CSS is DRY and attractive, uses CSS Grid, flexbox, and/or Bootstrap It looks good.
Under the Hood
Trip data is retrieved using from the API Check
JavaScript is well-organized and easy to read Well done
HTML is semantic A few too many divs without classes.
Overall A good start, but your registration doesn't work. See my comments in your code and above. The trick is that since you're depending on a form field to store the trip ID for the registration, you need to use jQuery to set it's value, and then convert it to a number before making the post request.

const reservationData = {
name: $('input[name="name"]').val(),
email: $('input[name="email"]').val(),
trip_id: $('input[name="trip_id"]').val()

Choose a reason for hiding this comment

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

You should also convert this into a number.

reportError(error);
console.log('something went wrong :c');
});
};

Choose a reason for hiding this comment

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

You should also do something here to set the form field value to the trip id.

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