File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
app/templates/server/api/thing Expand file tree Collapse file tree 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;<% } %>
1717function handleError ( res , statusCode ) {
1818 statusCode = statusCode || 500 ;
1919 return function ( err ) {
20- res . send ( statusCode , err ) ;
20+ res . status ( statusCode ) . send ( err ) ;
2121 } ;
2222}
2323
2424function responseWithResult ( res , statusCode ) {
2525 statusCode = statusCode || 200 ;
2626 return function ( entity ) {
2727 if ( entity ) {
28- return res . json ( statusCode , entity ) ;
28+ return res . status ( statusCode ) . json ( entity ) ;
2929 }
3030 } ;
3131}
3232
3333function handleEntityNotFound ( res ) {
3434 return function ( entity ) {
3535 if ( ! entity ) {
36- res . send ( 404 ) ;
36+ res . status ( 404 ) . end ( ) ;
3737 return null ;
3838 }
3939 return entity ;
@@ -58,7 +58,7 @@ function removeEntity(res) {
5858 < % if ( filters . mongooseModels ) { % > return entity . removeAsync ( ) < % }
5959 if ( filters . sequelizeModels ) { % > return entity . destroy ( ) < % } % >
6060 . then ( function ( ) {
61- return res . send ( 204 ) ;
61+ return res . status ( 204 ) . end ( ) ;
6262 } ) ;
6363 }
6464 } ;
You can’t perform that action at this time.
0 commit comments