diff --git a/controllers/friendController.js b/controllers/friendController.js index fdd0130ffe465283bda401f04a19f376decb848f..df229c67df3cf4490278f4fddef71c98755b9c18 100644 --- a/controllers/friendController.js +++ b/controllers/friendController.js @@ -25,6 +25,30 @@ class friendController { }); } } + + /** + * 받은 친구 요청 목록 조회 + * GET /api/friend/requests/received + */ + async getReceivedRequests(req, res) { + try { + const userId = req.user.id; + const requests = await FriendService.getReceivedRequests(userId); + + return res.status(200).json({ + success: true, + data: requests + }); + } catch (error) { + return res.status(500).json({ + success: false, + error: { + message: error.message, + code: 'FETCH_ERROR' + } + }); + } + } } module.exports = new friendController(); \ No newline at end of file