File tree 1 file changed +4
-4
lines changed
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) {
11
11
statusCode = statusCode || 200 ;
12
12
return function ( entity ) {
13
13
if ( entity ) {
14
- return res . json ( statusCode , entity ) ;
14
+ return res . status ( statusCode ) . json ( entity ) ;
15
15
}
16
16
} ;
17
17
}
@@ -41,7 +41,7 @@ function removeEntity(res) {
41
41
if ( entity ) {
42
42
return entity . removeAsync ( )
43
43
. then ( function ( ) {
44
- return res . send ( 204 ) ;
44
+ return res . status ( 204 ) ;
45
45
} ) ;
46
46
}
47
47
} ;
@@ -50,8 +50,8 @@ function removeEntity(res) {
50
50
// Get list of <%= name %>s
51
51
exports . index = function ( req , res ) { < % if ( ! filters . mongoose ) { % >
52
52
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 ) ; }
55
55
return res . status ( 200 ) . json ( < %= name % > s);
56
56
} ) ; < % } % >
57
57
} ; < % if ( filters . mongoose ) { % >
You can’t perform that action at this time.
0 commit comments