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

feat: 친구 삭제 (#7)

parent 108b1b25
No related branches found
No related tags found
2 merge requests!31Develop,!8[#7] Friend 서비스 로직 개발
......@@ -130,6 +130,26 @@ class friendService {
});
}
/**
* 친구 삭제
*/
async deleteFriend(userId, freindId) {
const result = await Friend.destroy({
where: {
[Op.or]: [
{user_id: userId, friend_id: friendId},
{user_id: friendId, friend_id: userId}
],
status: 'ACCEPTED'
}
});
if (!result) {
throw new Error('Friend relationship not found');
}
return result;
}
}
module.exports = new FriendService();
\ No newline at end of file
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