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

refactor: 오타 수정 (#7)

parent 11e08540
Branches
No related tags found
2 merge requests!31Develop,!8[#7] Friend 서비스 로직 개발
...@@ -37,7 +37,7 @@ class friendService { ...@@ -37,7 +37,7 @@ class friendService {
/** /**
* 받은 친구 요청 목록 조회 * 받은 친구 요청 목록 조회
*/ */
async getReveivedRequests(userId) { async getReceivedRequests(userId) {
return Friend.findAll({ return Friend.findAll({
where: { where: {
friend_id: userId, friend_id: userId,
...@@ -57,7 +57,7 @@ class friendService { ...@@ -57,7 +57,7 @@ class friendService {
async getSentRequests(userId) { async getSentRequests(userId) {
return Friend.findAll({ return Friend.findAll({
where: { where: {
user_Id: userId, user_id: userId,
status: 'PENDING' status: 'PENDING'
}, },
include: [{ include: [{
...@@ -81,7 +81,7 @@ class friendService { ...@@ -81,7 +81,7 @@ class friendService {
}); });
if (!request) { 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 { ...@@ -124,7 +124,7 @@ class friendService {
attributes: ['id', 'name', 'email'] attributes: ['id', 'name', 'email']
}, { }, {
model: User, model: User,
as: 'friend', as: 'user',
attributes: ['id', 'name', 'email'] attributes: ['id', 'name', 'email']
}] }]
}); });
...@@ -133,7 +133,7 @@ class friendService { ...@@ -133,7 +133,7 @@ class friendService {
/** /**
* 친구 삭제 * 친구 삭제
*/ */
async deleteFriend(userId, freindId) { async deleteFriend(userId, friendId) {
const result = await Friend.destroy({ const result = await Friend.destroy({
where: { where: {
[Op.or]: [ [Op.or]: [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment