Skip to content
Snippets Groups Projects
Commit 108b1b25 authored by 조대희's avatar 조대희
Browse files

feat: 친구 목록 조회 (#7)

parent 76e9c1dd
No related branches found
No related tags found
2 merge requests!31Develop,!8[#7] Friend 서비스 로직 개발
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment