-
Notifications
You must be signed in to change notification settings - Fork 44
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
Kimberley Zell - Pipes - BackTrek #36
base: master
Are you sure you want to change the base?
Conversation
…servation form when reserve a spot is clicked
BackTREKWhat We're Looking For
|
|
||
DISPLAY_TRIP_FIELDS.forEach((field) => { | ||
const headerElement = $(`th.sort.${ field }`); | ||
headerElement.on('click', (event) => { |
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 also need to add something to style the selected column. Right now it sorts, but doesn't indicate which column was sorted. Adding a class which changes the styling of the th
element would work well.
console.log(reservation.url); | ||
|
||
// reservation.save({}, { | ||
if (reservation.save) { |
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 doesn't actually call the reservation's save
function. Instead it checks to see if it exists.
Remember this isn't Rails!
Instead you need:
reservation.save({} {
success: someEventHandler,
error: someOtherEventHandler
});
// console.log(`In initialize: for the book ${ this.get('title') }`); | ||
}, | ||
|
||
validate(attributes) { |
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 is good, but you also need to test for:
- Continents that are valid (Asia, Africa etc).
- Valid numeric values for weeks and cost
const Reservation = Backbone.Model.extend({ | ||
url: function () { | ||
return `https://ada-backtrek-api.herokuapp.com/trips/${this.get("trip_id")}/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.
missing validations
BackTREK
Congratulations! You're submitting your assignment!
Comprehension Questions