Conversation
| let userData = { | ||
| 'name': $('input[name="user-name"]').val(), | ||
| 'email': $('input[name="email"]').val(), | ||
| }; |
There was a problem hiding this comment.
Since this is JavaScript, all property names (keys) are assumed to be strings, so you can write this as:
let userData = {
name: $('input[name="user-name"]').val(),
email: $('input[name="email"]').val(),
};| //RESERVE TRIP | ||
|
|
||
| const reserveTrip = (id) => { | ||
| reportStatus(''); |
| <input type="text" name="email" /> | ||
| </div> | ||
| <div class="submit-container"> | ||
| <input type="submit" name="add-reservation" value="Reserve" class="reserve" id="reserve${response.data.id}"/> |
There was a problem hiding this comment.
Out of curiosity, why do you make the id="reserve..."? Why not just id="${response.data.id}"? Because of this you need to add the .substr(7) part on line 105
| // ACTION | ||
| $(document).ready(() => { | ||
| $('#load').click(loadTrips); | ||
| $('#tbody').on('click', 'tr', function () { |
There was a problem hiding this comment.
something with the ID tbody doesn't make much sense 😆 because tbody doesn't help me understand what is unique about it, and IDs are to help me know what the unique identifier is. Also, it's on an element tbody
| tripsList.empty(); | ||
|
|
||
| reportStatus('Loading trips! Please wait...'); | ||
| $('#table').show(); |
There was a problem hiding this comment.
same comment as below, but: the ID #table isn't a very helpful ID name! Which table is it?
TREKWhat We're Looking For
One huge thing: your indentation is totally off! That being said... Good job with this project! It does everything correctly. I added a few comments, but otherwise good work |
TREK
Congratulations! You're submitting your assignment!
Comprehension Questions