File tree 1 file changed +4
-4
lines changed
app/templates/server/api/thing
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -17,23 +17,23 @@ var Thing = sqldb.Thing;<% } %>
17
17
function handleError ( res , statusCode ) {
18
18
statusCode = statusCode || 500 ;
19
19
return function ( err ) {
20
- res . send ( statusCode , err ) ;
20
+ res . status ( statusCode ) . send ( err ) ;
21
21
} ;
22
22
}
23
23
24
24
function responseWithResult ( res , statusCode ) {
25
25
statusCode = statusCode || 200 ;
26
26
return function ( entity ) {
27
27
if ( entity ) {
28
- return res . json ( statusCode , entity ) ;
28
+ return res . status ( statusCode ) . json ( entity ) ;
29
29
}
30
30
} ;
31
31
}
32
32
33
33
function handleEntityNotFound ( res ) {
34
34
return function ( entity ) {
35
35
if ( ! entity ) {
36
- res . send ( 404 ) ;
36
+ res . status ( 404 ) . end ( ) ;
37
37
return null ;
38
38
}
39
39
return entity ;
@@ -58,7 +58,7 @@ function removeEntity(res) {
58
58
< % if ( filters . mongooseModels ) { % > return entity . removeAsync ( ) < % }
59
59
if ( filters . sequelizeModels ) { % > return entity . destroy ( ) < % } % >
60
60
. then ( function ( ) {
61
- return res . send ( 204 ) ;
61
+ return res . status ( 204 ) . end ( ) ;
62
62
} ) ;
63
63
}
64
64
} ;
You can’t perform that action at this time.
0 commit comments