Repository navigation
fix: 새 항목의 표시 순서를 개수가 아닌 마지막 순서 + 1로 정한다 - #151
Merged
Merged
Conversation
10곳이 새 항목의 display_order를 "현재 행 수"로 정했는데, 삭제가 순서를 다시 매기지 않아 삭제 뒤 새 항목이 기존 항목과 같은 순서를 받았다(예: [0, 2]에 추가하면 2가 겹친다). 같은 순서끼리는 정렬이 정해지지 않아 공개 페이지 순서가 흔들릴 수 있었다. - DisplayOrders.next(형제 목록, 순서 getter): 비어 있으면 0, 아니면 마지막 순서 + 1. - 활동 분류, 커리큘럼·주차·토픽, 게임, 게임·트랙 페이지 부원, 멘토 슬롯, Q&A, 트랙 페이지에 적용한다.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 27 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
# Conflicts: # src/main/java/com/bcsdlab/bcsdinternalapiv2/curriculum/service/AdminCurriculumService.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
요약
10곳이 새 항목의
display_order를 현재 행 수(count()또는 목록size())로 정했다. 삭제할 때 순서를 다시 매기지 않으므로 삭제 뒤 새 항목이 기존 항목과 같은 순서를 받았다. 예: 순서[0, 1, 2]에서 1을 지우면[0, 2], 새로 추가하면 개수 2 →[0, 2, 2]. 같은 순서끼리는 정렬이 정해지지 않아 공개 페이지(홈 Q&A, 멘토, 트랙, 게임, 커리큘럼 등)의 순서가 흔들릴 수 있었다.display_order에는 유니크 제약이 없어 오류 없이 저장된다.변경
DisplayOrders.next(형제 목록(순서 오름차순), 순서 getter)— 비어 있으면 0, 아니면 마지막 순서 + 1.count()를 쓰던 4곳(게임·Q&A·트랙 페이지·멘토 슬롯)은 이미 있던 정렬 목록 조회를 쓴다(모두 수십 행 이하 테이블).PATCH .../order) 0부터 다시 매겨진다.테스트
DisplayOrdersTest(단위): 빈 목록 0, 빈 번호가 있어도 마지막 + 1.AdminQnaAndRecruitLinkIntegrationTest: Q&A 3개 생성 → 가운데 삭제 → 새로 생성하면 순서가 겹치지 않고 맨 뒤에 붙는다.Found duplicate(s): [2] in: [0, 2, 2]로 실패함을 확인했다../gradlew test: 543건 중 542 통과, 1 스킵.