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

feat: 친구 요청 수락 (#7)

parent a3718bfe
No related branches found
No related tags found
2 merge requests!31Develop,!8[#7] Friend 서비스 로직 개발
......@@ -50,6 +50,25 @@ class friendService {
}]
});
}
/**
* 친구 요청 수락
*/
async acceptFriendRequest(requestId, userId) {
const request = await Friend.findOne({
where: {
id: requestId,
friend_id: userId,
status: 'PENDING'
}
});
if (!request) {
throw new Error('Friend reqeust not found');
}
return request.update({ status: 'ACCEPTED '});
}
}
......
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