File tree 1 file changed +8
-5
lines changed
app/templates/server/api/user(auth)
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');
8
8
var config = require ( '../../config/environment' ) ;
9
9
var jwt = require ( 'jsonwebtoken' ) ;
10
10
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
+ }
14
17
15
18
function handleError ( res , statusCode ) {
16
19
statusCode = statusCode || 500 ;
17
20
return function ( err ) {
18
- res . send ( statusCode , err ) ;
21
+ res . status ( statusCode ) . send ( err ) ;
19
22
} ;
20
23
}
21
24
22
25
function respondWith ( res , statusCode ) {
23
26
statusCode = statusCode || 200 ;
24
27
return function ( ) {
25
- res . send ( statusCode ) ;
28
+ res . status ( statusCode ) . end ( ) ;
26
29
} ;
27
30
}
28
31
You can’t perform that action at this time.
0 commit comments