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

Hannah Cameron - Trek - Octos #35

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

Conversation

hannahlcameron
Copy link

TREK

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
What does it mean for code to be asynchronous? It means that not all the code is run at the same time - changes to the DOM occur only when certain events are triggered.
Describe a piece of your code that executes asynchronously. How did this affect the way you structured it? There is the need to push through a reservation of a trip, but unless a trip is clicked, there is no trip to reserve. Within the document.ready, I had to ensure that the event handler for the submitting was outside the event handler that displayed specific trips. If the reservation event handler had been nested, clicking on the button wouldn't have worked to actually reserve a trip.
What kind of errors might the API give you? How did you choose to handle them? The API could give errors if loading in the list of trips went awry, if loading in a specific trip didn't work (say a non-existing trip was requested) or if a reservation was submitted with incorrect information. I chose to handle these by displaying messages to the user that displayed a relevant message and then displayed the error messages from the API.
Do you have any recommendations on how we could improve this project for the next cohort? nope.

@kariabancroft
Copy link

TREK

What We're Looking For

Feature Feedback
Core Requirements
Git hygiene Good
Comprehension questions Yes
Functionality
Click a button to list trips Yes
Click a trip to see trip details Yes
Fill out a form to reserve a spot Yes
Errors are reported to the user Yes
Styling Yes
Under the Hood
Trip data is retrieved using from the API Yes
JavaScript is well-organized and easy to read Yes
HTML is semantic Yes, nice use of section and articles
Overall You were able to utilize the API calls to complete the major requirements of this assignment. You are still missing a lot of semi-colons so it would be a good exercise to go back through this code and add them wherever they are missing.

const URL = "https://ada-backtrek-api.herokuapp.com/trips"

const userMessage = (message) => {
$('#user-message').html(message)

Choose a reason for hiding this comment

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

Watch out for little expressions like these where you're missing semi-colons

const loadTrips = function loadTrips() {
const tripList = $('#trips-list');
tripList.empty();
userMessage('Loading in trips..')

Choose a reason for hiding this comment

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

Semi-colons on all of your userMessage function calls!


const reserveTrip = (event) => {
event.preventDefault();
const tripID = $('form')[0][2].value

Choose a reason for hiding this comment

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

A comment about what this code is doing would be good readability and reusability

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