-
Notifications
You must be signed in to change notification settings - Fork 54
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
Ellis's Personal API #26
base: master
Are you sure you want to change the base?
Conversation
|
||
function index(req, res){ | ||
db.Project.find({}, function(err, allProjects) { | ||
if (err) |
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.
Do you need these guys {} for the if statement?
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.
Not needed, but certainly encouraged (and required by pretty much every styleguide) to avoid the goto fail.
</div> | ||
</div> | ||
|
||
<!-- Text input--> |
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.
Looks like "deployed" is misspelled in this input of the form
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 code you have here is mostly beautiful, but it's a shame that it didn't get through having edit/delete working from your frontend.
|
||
function index(req, res){ | ||
db.Project.find({}, function(err, allProjects) { | ||
if (err) |
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.
Not needed, but certainly encouraged (and required by pretty much every styleguide) to avoid the goto fail.
|
||
function create(req, res){ | ||
db.Project.create(req.body, function(err, project) { | ||
if (err) { console.log('error', err); } |
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 😭
db.Project.findByIdAndUpdate(req.params.id, req.body, {new: true}, function (err, project){ | ||
res.json(project); | ||
}); | ||
} |
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 controllers are awesome.
Be gentle