-
Notifications
You must be signed in to change notification settings - Fork 54
Bryan Reese #35
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
base: master
Are you sure you want to change the base?
Bryan Reese #35
Conversation
public/scripts/app.js
Outdated
| }); | ||
|
|
||
|
|
||
|
|
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.
Short and sweet, works.
| .jumbotron { | ||
| opacity: 0.95; | ||
| } | ||
|
|
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.
Just doing what is needed.
| message: "Welcome to BJJ reviews!", | ||
| description: "This is a app that allows people to read reviews on Brazilian Jiu Jitsu Academy", | ||
| documentation_url: "https://github.com/breese8009/express-personal-api", | ||
| base_url: "localhost:4000", |
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.
Had to use different port.
mnfmnfm
left a comment
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.
Overall looks good--I wish you'd been able to get edit working.
| @@ -0,0 +1,55 @@ | |||
|
|
|||
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.
file name should just be bjjController.js, singular
| console.log('body', req.body); | ||
|
|
||
|
|
||
| db.Bjj.create(req.body, function(err, reviews) { |
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 gives back a singular, not a plural, so should probably have the variable name review rather than reviews
| function show(req, res) { | ||
| // find one gym by id and send it back as JSON | ||
| console.log(req.params.bjjId); | ||
| db.Bjj.findById(req.params.bjjId, function(err, foundAlbum) { |
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.
album 😭
|
|
||
| var bjjHtml = (` | ||
| <div class="container forms" data-bjj='${bjj._id}'> |
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 should be indented to reflect HTML structure.
| @@ -1,15 +1,8 @@ | |||
| // This file allows us to seed our application with data | |||
| // simply run: `node seed.js` from the root of this project folder. | |||
|
|
|||
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.
seed files are useful! please write them!
| <!-- gym data display div --> | ||
|
|
||
| <div id="gymDisplay"></div> | ||
| <!-- <div class="container"> |
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 much commented out code is usually a bad sign--better to take it out of this file entirely.
| $.ajax({ | ||
| method:"DELETE", | ||
| url: '/api/bjj/'+currentBjjId, | ||
| success: currentBjjElem.remove() |
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 removes that element immediately, not as a callback! It'll remove from the page whether or not the API call is successful. It should instead be:
success: function() {
currentBjjElem.remove();
}| <div class="container forms" data-bjj='${bjj._id}'> | ||
| <div class="row"> | ||
| <div class="col-sm-12"> | ||
| <div class="card" style="width: 75%;"> |
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.
manually setting width is so sad! could add another class so you can still use class-based styling for these cards.
|
|
||
| // loop through data and render to html | ||
| function renderMultipleReviews(reviews) { | ||
| console.log(reviews); |
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.
indentation 😭
| e.preventDefault(); | ||
| var formData = $(this).serialize(); | ||
| console.log('formData', formData); | ||
| $.post('/api/bjj', formData).done(renderMultipleReviews); |
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.
odd that you're using
Reviews site