From 0ecbfce0c04fd7a7264b3b64d124abe6a3a62d34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A1=B0=EB=8C=80=ED=9D=AC?= <joedaehui@ajou.ac.kr> Date: Sat, 16 Nov 2024 11:40:58 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EB=B3=B4=EB=82=B8=20=EC=B9=9C=EA=B5=AC?= =?UTF-8?q?=20=EB=AA=A9=EB=A1=9D=20=EC=A1=B0=ED=9A=8C=20=EC=BB=A8=ED=8A=B8?= =?UTF-8?q?=EB=A1=A4=EB=9F=AC=20(#8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controllers/friendController.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/controllers/friendController.js b/controllers/friendController.js index df229c6..2a9cb2e 100644 --- a/controllers/friendController.js +++ b/controllers/friendController.js @@ -49,6 +49,30 @@ class friendController { }); } } + + /** + * 보낸 친구 요청 목록 조회 + * GET /api/friend/requests/sent + */ + async getSentRequests(req, res) { + try { + const userId = req.user.id; + const requests = await FriendService.getSentRequests(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 -- GitLab