Skip to content
Snippets Groups Projects

[#7] Friend 서비스 로직 개발

Merged 조대희 requested to merge feature/#7 into develop
1 file
+ 24
0
Compare changes
  • Side-by-side
  • Inline
+ 24
0
@@ -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
Loading