From a3718bfe08e32b2c11378c6f6e547e0ed3653626 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 10:47:16 +0900
Subject: [PATCH] =?UTF-8?q?feat:=20=EB=B0=9B=EC=9D=80=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(#7)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 services/friendService.js | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/services/friendService.js b/services/friendService.js
index 8b93749..4620773 100644
--- a/services/friendService.js
+++ b/services/friendService.js
@@ -33,6 +33,24 @@ class friendService {
             status: 'PENDING'
         });
     }
+
+    /**
+     * 받은 친구 요청 목록 조회
+     */
+    async getReveivedRequests(userId) {
+        return Friend.findAll({
+            where: {
+                friend_id: userId,
+                status: 'PENDING'
+            },
+            include: [{
+                model: User,
+                as: 'user',
+                attributes: ['id', 'name', 'email']
+            }]
+        });
+    }
+    
 }
 
 module.exports = new FriendService();
\ No newline at end of file
-- 
GitLab