File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff 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
5151exports . 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 ) { % >
You can’t perform that action at this time.
0 commit comments