-
Notifications
You must be signed in to change notification settings - Fork 2
Refactor: 팔로워 목록 로직 수정, query 없는 경우 추가 #183
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -39,15 +39,32 @@ Slice<User> searchAccountInAll(@Param("query") String query, | |||||||||||||
| JOIN UserFollow uf ON u.id = uf.targetUser.id | ||||||||||||||
| WHERE uf.user.id = :loginUserId | ||||||||||||||
| AND (:cursor IS NULL OR u.id > :cursor) | ||||||||||||||
| AND (LOWER(u.nameId) LIKE LOWER(CONCAT(:query, '%')) | ||||||||||||||
| OR LOWER(u.nickname) LIKE LOWER(CONCAT(:query, '%'))) | ||||||||||||||
| AND (:query IS NULL OR | ||||||||||||||
| LOWER(u.nameId) LIKE LOWER(CONCAT(:query, '%')) | ||||||||||||||
| OR LOWER(u.nickname) LIKE LOWER(CONCAT(:query, '%'))) | ||||||||||||||
|
||||||||||||||
| AND (:query IS NULL OR | |
| LOWER(u.nameId) LIKE LOWER(CONCAT(:query, '%')) | |
| OR LOWER(u.nickname) LIKE LOWER(CONCAT(:query, '%'))) | |
| AND (:query IS NULL OR (LOWER(u.nameId) LIKE LOWER(CONCAT(:query, '%')) | |
| OR LOWER(u.nickname) LIKE LOWER(CONCAT(:query, '%')))) |
Outdated
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.
searchAccountInFollow 쿼리와 마찬가지로, 이 쿼리에서도 AND와 OR 연산자 우선순위로 인한 논리적 오류가 존재합니다. OR 조건들을 괄호로 묶어주세요.
| AND (:query IS NULL OR | |
| LOWER(u.nameId) LIKE LOWER(CONCAT(:query, '%')) | |
| OR LOWER(u.nickname) LIKE LOWER(CONCAT(:query, '%'))) | |
| AND (:query IS NULL OR | |
| (LOWER(u.nameId) LIKE LOWER(CONCAT(:query, '%')) | |
| OR LOWER(u.nickname) LIKE LOWER(CONCAT(:query, '%')))) |
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.
이
if(query == null)블록은 비어 있어 아무런 동작도 하지 않습니다. 불필요한 코드이므로 제거하는 것이 좋습니다.