From 108b1b257f8afb5b5cd0efd0fb1c903cf232859b 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:53:12 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=B9=9C=EA=B5=AC=20=EB=AA=A9=EB=A1=9D?= =?UTF-8?q?=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 | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/services/friendService.js b/services/friendService.js index 7ea6d76..517c36f 100644 --- a/services/friendService.js +++ b/services/friendService.js @@ -106,6 +106,30 @@ class friendService { return result; } + /** + * 移쒓뎄 紐⑸줉 議고쉶 + */ + async getFriendList(userId) { + return Friend.findAll({ + where: { + [Op.or]: [ + {user_id: userId}, + {friend_id: userId} + ], + status: 'ACCEPTED' + }, + include: [{ + model: User, + as: 'friend', + attributes: ['id', 'name', 'email'] + }, { + model: User, + as: 'friend', + attributes: ['id', 'name', 'email'] + }] + }); + } + } module.exports = new FriendService(); \ No newline at end of file -- GitLab