Skip to content

Commit 96e57b1

Browse files
committed
fix profile update api
1 parent f62bd95 commit 96e57b1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/routes/v1/profile/user.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ router.get('/public/id/:id', validator(schema.userId, ValidationSource.PARAM),
1515
asyncHandler(async (req: ProtectedRequest, res, next) => {
1616
const user = await UserRepo.findPublicProfileById(new Types.ObjectId(req.params.id));
1717
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);
1919
}));
2020

2121
/*-------------------------------------------------------------------------*/
@@ -27,7 +27,7 @@ router.get('/my',
2727
asyncHandler(async (req: ProtectedRequest, res, next) => {
2828
const user = await UserRepo.findProfileById(req.user._id);
2929
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);
3131
}));
3232

3333
router.put('/', validator(schema.profile),
@@ -39,7 +39,7 @@ router.put('/', validator(schema.profile),
3939
if (req.body.profilePicUrl) user.profilePicUrl = req.body.profilePicUrl;
4040

4141
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);
4343
}));
4444

4545
module.exports = router;

0 commit comments

Comments
 (0)