-
Notifications
You must be signed in to change notification settings - Fork 48
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
base: master
Are you sure you want to change the base?
Sockets - Maria #27
Conversation
function reserveSpot(){ | ||
var _name = $("#inputName").val(); | ||
var _email = $("#inputEmail").val(); | ||
urlDynamic = urlDynamic+"/reservations"; |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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."); |
There was a problem hiding this comment.
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.
TREKWhat We're Looking For
|
Congratulations! You're submitting your assignment!
Comprehension Questions
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.