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

Sockets - Maria #27

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

Sockets - Maria #27

wants to merge 7 commits into from

Conversation

MariaWissler
Copy link

@MariaWissler MariaWissler commented Jun 3, 2019

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
What does it mean for code to be asynchronous? It allows multiple things to happen at the same time. When you start an action, your program continues to run.
Describe a piece of your code that executes asynchronously. How did this affect the way you structured it? We use axios to make AJAX requests which are asynchronous, I used the invisible addClass and removeClass for trip details and booking so they show once a user selects a trip from the main list
What kind of errors might the API give you? How did you choose to handle them? 400 errors , I didnt parse my errors but still display an alert
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. I think having the list sorted makes the search faster but we still have the Id available to find it

function reserveSpot(){
var _name = $("#inputName").val();
var _email = $("#inputEmail").val();
urlDynamic = urlDynamic+"/reservations";

Choose a reason for hiding this comment

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

This tacks on reservations, so each time you try to reserve a spot, the URL gets longer.

ie URL on first click= https://trektravel.herokuapp.com/trips/##/reservations/
on second= https://trektravel.herokuapp.com/trips/##/reservations/

<small
id="emailHelp"
class="form-text text-muted"
>We'll never share your email with anyone

Choose a reason for hiding this comment

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

I'd hope not!

.append($("<button>")
.addClass("btn btn-default viewDetail")
.data("idTrip",item.id)
.append("Trip "+item.id + " " +item.name)

Choose a reason for hiding this comment

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

The formatting here is kind of wonky

@@ -0,0 +1,90 @@
const URL_ALL_TRIPS = "https://trektravel.herokuapp.com/trips"
var urlDynamic = URL_ALL_TRIPS; //so its easier to modify for different calls

Choose a reason for hiding this comment

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

You're putting the current trip ID in this global scope in order to store what the current trip is... You should consider different approaches to get the value of the current trip id. Could you use a closure or read from the HTML with event delegation?

Also, we use let, not var!

alert("Your reservation was successful!!.");
}
}).catch(function(error){
alert("Sorry an error ocurred, please try again.");

Choose a reason for hiding this comment

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

These error messages don't tell us anything about what is going wrong with this request. You're not making an effort to describe in detail what the user needs to do to continue properly.

@dHelmgren
Copy link

TREK

What We're Looking For

Feature Feedback
Core Requirements
Git hygiene good
Comprehension questions
Functionality
Click a button to load and view a list of trips yes
Clicking the "load" button twice does not cause each trip to display twice yes
Click a trip to load and view trip details yes
Clicking a different trip loads different details yes
Open network tab, then fill out a form to reserve a spot yes, but see comment.
Submitting the form only sends one POST request yes
Errors are reported to the user not really, see comments
Site is clearly laid out and easy to navigate yes
Under the Hood
Callback functions are not nested more than 2 levels deep yes
Callback functions are given descriptive names yes
Code is generally well-organized and easy to read yes
All API calls have both success and error callbacks defined yes
Optional but recommended: closures are used to keep track of which trip is selected no
HTML is semantic No
CSS is DRY, uses CSS Grid, Flexbox, and/or Bootstrap yes
Overall Great job overall! This code is for the most part well-organized and easy to read, and it's clear the learning goals of this assignment were met. I've left a couple inline comments for you to review below, but in general I am quite happy with this submission. Keep up the hard work!

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