Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
질문방(Q&A) 조회 시 현재 로그인 사용자의 이해도 체크(O/X) 선택 상태를 함께 내려주고, 프론트에서 해당 상태를 초기 반영 및 선택/취소 토글 시 서버 응답 기준으로 동기화되도록 개선하는 PR입니다.
Changes:
- 백엔드 질문방 조회 응답(
UnderstandingCheckResponse)에 로그인 유저의selectedChoice를 포함하도록 확장 - 질문방 조회 로직에서 로그인 유저 기준 이해도 응답을 조회해
selectedChoice를 계산/주입 - 프론트에서 진입 시
selectedChoice를 초기 상태로 반영하고, O/X 클릭 시 요청/롤백 및 서버 응답으로 상태 동기화
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| frontend/src/pages/qna/QnAListPage.js | 서버에서 내려준 selectedChoice로 초기 선택 상태를 반영하고, O/X 클릭 시 토글 및 동기화 로직을 수정 |
| backend/src/main/java/com/example/Piroin/project/domain/question/service/QuestionService.java | 질문방 조회 시 로그인 유저의 이해도 선택 상태를 조회해 응답 DTO에 포함 |
| backend/src/main/java/com/example/Piroin/project/domain/question/dto/QuestionResDTO.java | UnderstandingCheckResponse에 selectedChoice 필드 추가 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
134
to
149
| @@ -135,10 +143,12 @@ function QnAListPage() { | |||
| notUnderstoodCount: json.result.notUnderstoodCount, | |||
| attendanceCount: json.result.attendanceCount, | |||
| respondedCount: json.result.respondedCount, | |||
| selectedChoice: json.result.selectedChoice, | |||
| } | |||
| })); | |||
| } | |||
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.
#️⃣연관된 이슈
#174
📝작업 내용
이해도 체크 응답 DTO에 선택 상태 추가
UnderstandingCheckResponse에selectedChoice필드 추가UNDERSTOOD또는NOT_UNDERSTOOD반환null반환질문방 조회 시 로그인 유저의 이해도 선택 상태 조회
getQuestionRoom()에서 로그인 유저 정보를 기반으로 이해도 체크 응답 조회UnderstandingResponseRepository.findByCheckAndUser()를 통해 현재 유저의 선택값 확인selectedChoice로 응답에 포함프론트 이해도 체크 선택 상태 반영
selectedChoice를myChoices상태에 초기 반영selectedChoice기준으로 상태 동기화이해도 응답 제출 로직 수정