From 92f088303e0b677a8cb89ffb82b8463c5a837c5b 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:44:59 +0900
Subject: [PATCH] =?UTF-8?q?feat:=20=EC=B9=9C=EA=B5=AC=20=EC=9A=94=EC=B2=AD?=
 =?UTF-8?q?=20=EA=B1=B0=EC=A0=88=20=EC=BB=A8=ED=8A=B8=EB=A1=A4=EB=9F=AC=20?=
 =?UTF-8?q?(#8)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 controllers/friendController.js | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/controllers/friendController.js b/controllers/friendController.js
index 88e13ec..8bcc10a 100644
--- a/controllers/friendController.js
+++ b/controllers/friendController.js
@@ -99,6 +99,32 @@ class friendController {
             });
         }
     }
+
+    /**
+     * 친구 요청 거절
+     * POST /api/friend/request/:requestId/reject
+     */
+    async rejectRequest(req, res) {
+        try {
+            const userId = req.user.id;
+            const { requesId } = req.params;
+
+            const result = await FriendService.rejectFriendRequest(requesId, userId);
+
+            return res.status(200).json({
+                success: true,
+                data: result
+            });
+        } catch (error) {
+            return res.status(400).json({
+                success: false,
+                error: {
+                    message: error.message,
+                    code: 'REQUEST_REJECT_ERROR'
+                }
+            });
+        }
+    }
 }
 
 module.exports = new friendController();
\ No newline at end of file
-- 
GitLab