-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PlaceRepository에서 Repository 대신 SoftDeleteRepository로 리팩토링 #59
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -5,7 +5,7 @@ export class PlaceNotFoundException extends BaseException { | |||
constructor() { | |||
super({ | |||
code: 1002, | |||
message: '검색 결과가 없습니다.', | |||
message: '해당 장소가 존재하지 않습니다.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
p3. id 등을 인자로 받는건 어떨까요?
ex) 1번 장소가 존재하지 않습니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
반영했습니다!
}); | ||
} | ||
|
||
softDelete(id: number) { | ||
return super.update(id, { deletedAt: new Date() } as any); | ||
} | ||
|
||
private applyDeletedAtCondition(where: any) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
대괄호 조건은 몰랐는데 좋네요 ㅎㅎ
{ name: ILike(`%${query}%`) }, | ||
], | ||
skip: (page - 1) * pageSize, | ||
take: pageSize, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
지도 쪽에도 페이징에 대한 중복 조건이 있는데 나중에 분리할지 고민해 보아요
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
넵 좋습니다!
6021221
to
f240aff
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수고 많았습니다!
📄 Summary
SoftDeleteRepository
에서where
절을 배열로 받는 경우 처리를 위해 코드 수정Place
에서 TypeORMRepository
를 상속받은SoftDeleteRepository
로 리팩토링service
에 파라미터 추가🙋🏻 More
참고 : Find Options | typeorm
where
에서 대괄호 -> OR / 중괄호 -> AND🕰️ Actual Time of Completion
close #52