Skip to content
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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

ellismitchell
Copy link

Be gentle


function index(req, res){
db.Project.find({}, function(err, allProjects) {
if (err)
Copy link

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?

Copy link

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-->
Copy link

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

Copy link

@mnfmnfm mnfmnfm left a 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)
Copy link

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); }
Copy link

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);
});
}
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants