@@ -15,7 +15,7 @@ router.get('/public/id/:id', validator(schema.userId, ValidationSource.PARAM),
15
15
asyncHandler ( async ( req : ProtectedRequest , res , next ) => {
16
16
const user = await UserRepo . findPublicProfileById ( new Types . ObjectId ( req . params . id ) ) ;
17
17
if ( user == null ) throw new BadRequestError ( 'User not registered' ) ;
18
- return new SuccessResponse ( 'success' , _ . pick ( user , [ 'name' , 'profilePicUrl' ] ) ) ;
18
+ return new SuccessResponse ( 'success' , _ . pick ( user , [ 'name' , 'profilePicUrl' ] ) ) . send ( res ) ;
19
19
} ) ) ;
20
20
21
21
/*-------------------------------------------------------------------------*/
@@ -27,7 +27,7 @@ router.get('/my',
27
27
asyncHandler ( async ( req : ProtectedRequest , res , next ) => {
28
28
const user = await UserRepo . findProfileById ( req . user . _id ) ;
29
29
if ( user == null ) throw new BadRequestError ( 'User not registered' ) ;
30
- return new SuccessResponse ( 'success' , _ . pick ( user , [ 'name' , 'profilePicUrl' , 'roles' ] ) ) ;
30
+ return new SuccessResponse ( 'success' , _ . pick ( user , [ 'name' , 'profilePicUrl' , 'roles' ] ) ) . send ( res ) ;
31
31
} ) ) ;
32
32
33
33
router . put ( '/' , validator ( schema . profile ) ,
@@ -39,7 +39,7 @@ router.put('/', validator(schema.profile),
39
39
if ( req . body . profilePicUrl ) user . profilePicUrl = req . body . profilePicUrl ;
40
40
41
41
await UserRepo . updateInfo ( user ) ;
42
- return new SuccessResponse ( 'Profile updated' , _ . pick ( user , [ 'name' , 'profilePicUrl' , 'roles' ] ) ) ;
42
+ return new SuccessResponse ( 'Profile updated' , _ . pick ( user , [ 'name' , 'profilePicUrl' , 'roles' ] ) ) . send ( res ) ;
43
43
} ) ) ;
44
44
45
45
module . exports = router ;
0 commit comments