Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

Commit

Permalink
hotfix: 팔로우, 팔로잉 목록 탈퇴한 유저 필터링
Browse files Browse the repository at this point in the history
  • Loading branch information
JangYouJung committed Feb 16, 2024
1 parent 1e4dfbb commit 313bbaa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/user/user.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,10 @@ export class UserEntity extends BaseEntity {

static async findExistUser(userId) {
const user = await UserEntity.findOne({
where: { id: userId },
where: {
id: userId,
isQuit: false,
},
});
if (!user) {
throw new NotFoundException(BaseResponse.USER_NOT_FOUND);
Expand Down
10 changes: 8 additions & 2 deletions src/user/user.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,10 @@ export class UserService {
async getFollowingList(userId: number) {
try {
return await UserFollowingEntity.find({
where: { user: { id: userId, isQuit: false } },
where: {
user: { id: userId, isQuit: false },
followUser: { isQuit: false },
},
relations: { followUser: { profileImage: true } },
});
} catch (error) {
Expand All @@ -446,7 +449,10 @@ export class UserService {
async getFollowerList(userId: number) {
try {
return await UserFollowingEntity.find({
where: { followUser: { id: userId, isQuit: false } },
where: {
followUser: { id: userId, isQuit: false },
user: { isQuit: false },
},
relations: { user: { profileImage: true } },
});
} catch (error) {
Expand Down

0 comments on commit 313bbaa

Please sign in to comment.