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

refactor: 오타 수정 (#7)

parent 11e08540
No related branches found
No related tags found
2 merge requests!31Develop,!8[#7] Friend 서비스 로직 개발
......@@ -37,7 +37,7 @@ class friendService {
/**
* 받은 친구 요청 목록 조회
*/
async getReveivedRequests(userId) {
async getReceivedRequests(userId) {
return Friend.findAll({
where: {
friend_id: userId,
......@@ -57,7 +57,7 @@ class friendService {
async getSentRequests(userId) {
return Friend.findAll({
where: {
user_Id: userId,
user_id: userId,
status: 'PENDING'
},
include: [{
......@@ -81,10 +81,10 @@ class friendService {
});
if (!request) {
throw new Error('Friend reqeust not found');
throw new Error('Friend request not found');
}
return request.update({ status: 'ACCEPTED '});
return request.update({ status: 'ACCEPTED'});
}
/**
......@@ -124,7 +124,7 @@ class friendService {
attributes: ['id', 'name', 'email']
}, {
model: User,
as: 'friend',
as: 'user',
attributes: ['id', 'name', 'email']
}]
});
......@@ -133,7 +133,7 @@ class friendService {
/**
* 친구 삭제
*/
async deleteFriend(userId, freindId) {
async deleteFriend(userId, friendId) {
const result = await Friend.destroy({
where: {
[Op.or]: [
......
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