diff --git a/app/templates/server/api/thing/thing.controller(models).js b/app/templates/server/api/thing/thing.controller(models).js index a14fbd4b3..c7874b515 100644 --- a/app/templates/server/api/thing/thing.controller(models).js +++ b/app/templates/server/api/thing/thing.controller(models).js @@ -17,7 +17,7 @@ var Thing = sqldb.Thing;<% } %> function handleError(res, statusCode) { statusCode = statusCode || 500; return function(err) { - res.send(statusCode, err); + res.status(statusCode).send(err); }; } @@ -25,7 +25,7 @@ function responseWithResult(res, statusCode) { statusCode = statusCode || 200; return function(entity) { if (entity) { - return res.json(statusCode, entity); + return res.status(statusCode).json(entity); } }; } @@ -33,7 +33,7 @@ function responseWithResult(res, statusCode) { function handleEntityNotFound(res) { return function(entity) { if (!entity) { - res.send(404); + res.status(404).end(); return null; } return entity; @@ -58,7 +58,7 @@ function removeEntity(res) { <% if (filters.mongooseModels) { %>return entity.removeAsync()<% } if (filters.sequelizeModels) { %>return entity.destroy()<% } %> .then(function() { - return res.send(204); + return res.status(204).end(); }); } };