Skip to content

Commit

Permalink
Rebased 201:created part of balderdashy#773 (3d086c7)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikermcneil committed Sep 16, 2013
1 parent 36e1339 commit 9fb10eb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/hooks/controllers/controller.create.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ module.exports = function (sails) {
Model.publishCreate(model.toJSON()); // req.socket
}

// Otherwise return JSON
// Set status code (HTTP 201: Created)
res.status(201);

// and respond with JSON or JSONP
if ( sails.config.controllers.blueprints.jsonp ) {
return res.jsonp(model.toJSON());
}
Expand Down

0 comments on commit 9fb10eb

Please sign in to comment.