Skip to content

Commit

Permalink
getAllMyFriends
Browse files Browse the repository at this point in the history
  • Loading branch information
Dobrunia committed Nov 16, 2023
1 parent 09b161d commit f9735d4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
12 changes: 10 additions & 2 deletions controlers/user-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,16 @@ class UserController {
}
async getAllFriendsInfo(request, response, next) {
try {
const chatId = await getAllFriendsInfo(request.params.id);
response.json(chatId);
const friendsInfo = await getAllFriendsInfo(request.params.id);
response.json(friendsInfo);
} catch (error) {
next(error);
}
}
async getAllMyFriends(request, response, next) {
try {
const friendsInfo = await getAllFriendsInfo(request.user.id);
response.json(friendsInfo);
} catch (error) {
next(error);
}
Expand Down
1 change: 1 addition & 0 deletions router/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ router.get('/getNotifications', checkHeader, userController.getNotifications);
router.get('/isUserLoggedInCheck', checkHeader, userController.isUserLoggedInCheck);
router.get('/getFriendStatusInfo/:userId', checkHeader, userController.getFriendStatusInfo);
router.get('/getAllFriendsInfo/:id', checkHeader, userController.getAllFriendsInfo);
router.get('/getAllMyFriends', checkHeader, userController.getAllMyFriends);

//messageController
router.post('/addPost', checkHeader, multer.single('photo'), messageController.addPost);
Expand Down

0 comments on commit f9735d4

Please sign in to comment.