Skip to content

[Fix] 이해도 체크 선택 상태 응답 추가#176

Merged
issuejong merged 2 commits into
developfrom
fix/#174
Jun 7, 2026
Merged

[Fix] 이해도 체크 선택 상태 응답 추가#176
issuejong merged 2 commits into
developfrom
fix/#174

Conversation

@issuejong

Copy link
Copy Markdown
Collaborator

#️⃣연관된 이슈

#174

📝작업 내용

질문방 조회 시 현재 로그인 사용자가 선택한 이해도 체크 응답 상태를 함께 내려주도록 수정하고, 프론트에서 선택/취소 상태가 정상 반영되도록 개선했습니다.

  • 이해도 체크 응답 DTO에 선택 상태 추가

    • UnderstandingCheckResponseselectedChoice 필드 추가
    • 현재 로그인 유저가 선택한 값이 있으면 UNDERSTOOD 또는 NOT_UNDERSTOOD 반환
    • 선택하지 않았거나 응답을 취소한 상태면 null 반환
  • 질문방 조회 시 로그인 유저의 이해도 선택 상태 조회

    • getQuestionRoom()에서 로그인 유저 정보를 기반으로 이해도 체크 응답 조회
    • UnderstandingResponseRepository.findByCheckAndUser()를 통해 현재 유저의 선택값 확인
    • 조회된 선택값을 selectedChoice로 응답에 포함
  • 프론트 이해도 체크 선택 상태 반영

    • 질문방 진입 시 서버에서 받은 selectedChoicemyChoices 상태에 초기 반영
    • O/X 버튼 클릭 시 기존 선택값과 비교하여 선택/취소 상태 처리
    • 응답 성공 시 서버 응답의 selectedChoice 기준으로 상태 동기화
    • 요청 실패 시 이전 선택 상태로 롤백
  • 이해도 응답 제출 로직 수정

    • 같은 선택지를 다시 누르는 경우에도 서버에 요청을 보내 응답 취소가 반영되도록 수정
    • 프론트에서 임의로 요청을 중단하지 않고, 서버의 토글 결과를 기준으로 화면 상태 갱신

@issuejong issuejong requested a review from Copilot June 7, 2026 01:53
@issuejong issuejong self-assigned this Jun 7, 2026
@issuejong issuejong added the bug Something isn't working label Jun 7, 2026
@issuejong issuejong linked an issue Jun 7, 2026 that may be closed by this pull request
@vercel

vercel Bot commented Jun 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
piro-in Ready Ready Preview, Comment Jun 7, 2026 1:59am
piro-in-765d Ready Ready Preview, Comment Jun 7, 2026 1:59am

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 UnderstandingCheckResponseselectedChoice 필드 추가

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread frontend/src/pages/qna/QnAListPage.js Outdated
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,
}
}));
}
@issuejong issuejong merged commit 546f3f2 into develop Jun 7, 2026
3 checks passed
@issuejong issuejong deleted the fix/#174 branch June 7, 2026 02:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] 이해도 체크 응답 상태 로직 수정

2 participants