Skip to content

Commit 1bcffd6

Browse files
committed
fix(gen:endpoint): Fix JSCS stuff and use Express 4 syntax
1 parent 349b6d3 commit 1bcffd6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Diff for: endpoint/templates/name.controller.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function responseWithResult(res, statusCode) {
1111
statusCode = statusCode || 200;
1212
return function(entity) {
1313
if (entity) {
14-
return res.json(statusCode, entity);
14+
return res.status(statusCode).json(entity);
1515
}
1616
};
1717
}
@@ -41,7 +41,7 @@ function removeEntity(res) {
4141
if (entity) {
4242
return entity.removeAsync()
4343
.then(function() {
44-
return res.send(204);
44+
return res.status(204);
4545
});
4646
}
4747
};
@@ -50,8 +50,8 @@ function removeEntity(res) {
5050
// Get list of <%= name %>s
5151
exports.index = function(req, res) {<% if (!filters.mongoose) { %>
5252
res.json([]);<% } %><% if (filters.mongoose) { %>
53-
<%= classedName %>.find(function (err, <%= name %>s) {
54-
if(err) { return handleError(res, err); }
53+
<%= classedName %>.find(function(err, <%= name %>s) {
54+
if (err) { return handleError(res, err); }
5555
return res.status(200).json(<%= name %>s);
5656
});<% } %>
5757
};<% if (filters.mongoose) { %>

0 commit comments

Comments
 (0)