File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
app/templates/server/api/user(auth) Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -8,21 +8,24 @@ var passport = require('passport');
88var config = require ( '../../config/environment' ) ;
99var jwt = require ( 'jsonwebtoken' ) ;
1010
11- var validationError = function ( res , err ) {
12- return res . status ( 422 ) . json ( err ) ;
13- } ;
11+ function validationError ( res , statusCode ) {
12+ statusCode = statusCode || 422 ;
13+ return function ( err ) {
14+ res . status ( statusCode ) . json ( err ) ;
15+ }
16+ }
1417
1518function handleError ( res , statusCode ) {
1619 statusCode = statusCode || 500 ;
1720 return function ( err ) {
18- res . send ( statusCode , err ) ;
21+ res . status ( statusCode ) . send ( err ) ;
1922 } ;
2023}
2124
2225function respondWith ( res , statusCode ) {
2326 statusCode = statusCode || 200 ;
2427 return function ( ) {
25- res . send ( statusCode ) ;
28+ res . status ( statusCode ) . end ( ) ;
2629 } ;
2730}
2831
You can’t perform that action at this time.
0 commit comments