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

feat: 친구 요청 거절 (#7)

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