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

Commit

Permalink
fix : 탈퇴 여부 확인 수정 (#227)
Browse files Browse the repository at this point in the history
  • Loading branch information
yewonahn authored Feb 15, 2024
2 parents 0d355df + 7b55664 commit 4ac1a08
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
6 changes: 5 additions & 1 deletion src/follow/follow.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ export class FollowService {
const [resultUsers, total] = await UserEntity.findAndCount({
take: cursorPageOptionsDto.take,
where: [
{id: cursorId ? LessThan(cursorId) : null, nickname: Like(`%${searchTerm}%`)}
{
id: cursorId ? LessThan(cursorId) : null,
nickname: Like(`%${searchTerm}%`),
isQuit: false,
}
],
relations: {profileImage : true, follower : true, following : true},
order: {
Expand Down
12 changes: 8 additions & 4 deletions src/rule/rule.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,6 @@ export class RuleService {
const user = await UserEntity.findOne({
where: {
id: userId,
isQuit: true,
},
});
if (!user) throw new Error('사용자를 찾을 수 없습니다');
Expand Down Expand Up @@ -478,9 +477,12 @@ export class RuleService {
});
console.log('resultFollowingEntities', resultFollowingEntities);

// 3번 검색 조건) 탈퇴 여부 확인
resultFollowingEntities = resultFollowingEntities.filter(userFollowingEntity => userFollowingEntity.followUser.isQuit == false);

const total = resultFollowingEntities.length;

// 3번 검색 조건) id 가 cursorId 보다 작은
// 4번 검색 조건) id 가 cursorId 보다 작은
// 해당 요소보다 작은 요소들만 필터링
for(const userFollowingEntity of resultFollowingEntities) {
console.log('userFollowingEntity.followUser.id : ', userFollowingEntity.followUser.id);
Expand Down Expand Up @@ -552,7 +554,6 @@ export class RuleService {
const user = await UserEntity.findOne({
where: {
id: userId,
isQuit: true,
},
});
if (!user) throw new Error('사용자를 찾을 수 없습니다');
Expand Down Expand Up @@ -621,9 +622,12 @@ export class RuleService {
});
console.log('resultFollowingEntities', resultFollowingEntities);

// 3번 검색 조건) 탈퇴 여부 확인
resultFollowingEntities = resultFollowingEntities.filter(userFollowingEntity => userFollowingEntity.followUser.isQuit == false);

const total = resultFollowingEntities.length;

// 3번 검색 조건) id 가 cursorId 보다 작은
// 4번 검색 조건) id 가 cursorId 보다 작은
// 해당 요소보다 작은 요소들만 필터링
for(const userFollowingEntity of resultFollowingEntities) {
console.log('userFollowingEntity.followUser.id : ', userFollowingEntity.followUser.id);
Expand Down

0 comments on commit 4ac1a08

Please sign in to comment.