Skip to content

[FEAT] 코스 후기 API 응답 변경 반영 - #263

Merged
junehuk merged 5 commits into
developfrom
feature/review-course-type
Aug 6, 2026
Merged

[FEAT] 코스 후기 API 응답 변경 반영#263
junehuk merged 5 commits into
developfrom
feature/review-course-type

Conversation

@junehuk

@junehuk junehuk commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

작업 내용

  • 코스별 후기 응답의 이미지 구조 교체(imageUrlsimages). imageKey·imageOrder가 함께 와서 전체 후기 목록과 모양이 같아졌습니다
  • 코스 상세·후기 전체보기의 후기 수정 진입 해제. imageKey가 없어 유지할 사진을 지목할 수 없던 제약이 풀렸습니다
  • 후기 응답의 courseType으로 코스 상세 경로를 정하도록 변경. 라우트 판별용 선조회를 제거해 카드 탭 시 네트워크 왕복이 사라졌습니다
  • 작성자 메타에 성별 반영("20대" → "20대 여")
  • 이동수단 라벨 prop 이름을 courseTypetransport로 정정(새로 생긴 코스 타입과 이름이 겹쳤습니다)

변경 화면

  • / 홈 최근 후기
  • /recent-review-courses 최근 후기
  • /{yeogido|local}-course/detail/:courseId 코스 상세 후기 미리보기
  • /{yeogido|local}-course/detail/:courseId/reviews 후기 전체보기

확인 방법

  1. 네 화면 모두에서 후기 사진이 뜨는지 확인 (반영 전에는 뒤 두 화면이 비어 있음)
  2. 작성자가 "나이 성별" 형태로 표시되는지 확인
  3. 내가 쓴 후기의 ⋯ → 수정에서 사진 추가·삭제 후 저장 → 목록에 반영되는지 확인 (네 화면 모두)
  4. 여기도 코스 후기 카드 탭 → /yeogido-course/detail/:id, 동네 코스 후기 카드 탭 → /local-course/detail/:id로 가는지 확인
  5. 찜 목록(/likes)에서 코스 카드 탭 시 이동이 그대로 되는지 확인

체크리스트

  • 로컬 실행 확인
  • 콘솔 에러 없음
  • 반응형 확인
  • 불필요한 console.log 제거
  • develop 최신 반영 완료
  • 관련 없는 파일 변경 없음

스크린샷

image image

참고 사항

useNavigateToCourseDetail을 지웠다가 되살렸습니다. 후기 응답에 courseType이 생겨 필요 없어졌는데, develop에서 머지된 찜 목록(#252)이 이 훅을 쓰기 시작했습니다. LikedResponse에는 courseType이 없어 선조회가 실제로 필요해서 되살렸고, 어느 쪽을 써야 하는지 주석에 적어 뒀습니다. 찜 목록 페이지 자체는 건드리지 않았습니다.

courseDetailMock.ts에 필드 하나를 추가했습니다. 죽은 코드지만 타입 체크에 걸려서 빌드를 위해 필요했습니다. 정리는 별도 작업이 맞다고 봅니다.

관련 이슈

Closes #262

Summary by CodeRabbit

  • 새로운 기능
    • 코스 상세 및 후기 목록에서 작성한 후기를 수정할 수 있습니다.
    • 후기 수정 시 기존 사진을 유지하거나 변경할 수 있습니다.
  • 개선 사항
    • 후기 카드에 이동 수단 정보가 더욱 정확하게 표시됩니다.
    • 후기 이미지와 작성자 정보가 새로운 형식에 맞게 표시됩니다.
    • 후기 및 찜 목록에서 코스 상세 페이지로 이동하는 경로가 개선되었습니다.
  • 버그 수정
    • 후기 이미지 정렬과 수정 시 이미지 처리 문제가 개선되었습니다.

junehuk added 4 commits August 6, 2026 19:24
- ReviewCourse에 추가된 courseType을 매퍼에서 그대로 넘김
- 라우트 판별용 코스 상세 선조회(useNavigateToCourseDetail) 제거
- 이동수단 라벨 prop 이름을 transport로 바로잡아 코스 타입과 구분
develop의 찜 목록이 useNavigateToCourseDetail을 쓰기 시작했다.
LikedResponse에는 courseType이 없어 선조회가 필요하다.
후기는 응답에 courseType이 있어 계속 buildCourseDetailPath로 바로 이동한다.
- 코스별 후기 응답이 imageUrls에서 images(imageKey 포함)로 바뀐 것을 반영
- 코스 상세와 후기 전체보기에서 막아 뒀던 수정 진입을 연다
- 작성자 메타에 성별을 붙여 20대 여 형태로 표시
@vercel

vercel Bot commented Aug 6, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
frontend Ready Ready Preview Aug 6, 2026 2:28pm

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

리뷰 응답의 이미지, 성별, 코스 타입 필드를 새 스키마에 맞게 반영했습니다. 홈, 최근 후기, 코스 상세, 후기 전체보기 화면에 리뷰 수정 진입과 코스 상세 이동을 연결했습니다.

Changes

리뷰 응답 계약과 이미지 매핑

Layer / File(s) Summary
리뷰 응답 계약과 이미지 매핑
src/types/review.type.ts, src/utils/reviewCard.ts, src/pages/detail/mappers/courseReviewMapper.ts, src/pages/detail/types/courseDetail.ts, src/pages/detail/constants/courseDetailMock.ts, tests/course-review-mapper.test.ts
imageUrlsReviewImage[] 기반 images로 변경했습니다. 이미지 URL과 editableImages를 분리해 생성합니다. gendercourseType 필드를 반영했습니다. 관련 매핑 테스트를 갱신했습니다.

리뷰 수정 진입 연결

Layer / File(s) Summary
리뷰 수정 진입 연결
src/hooks/useReviews.ts, src/components/common/ReviewEditModal.tsx, src/pages/course-reviews/index.tsx, src/pages/detail/components/CourseDetailLayout.tsx, src/pages/detail/components/DetailReviewSection.tsx
홈 및 최근 후기 화면과 코스 상세 및 전체보기 화면에서 ReviewEditModal을 렌더링합니다. 각 ReviewCard의 수정 콜백을 useReviewEdit에 연결했습니다. useUpdateReview는 모듈 내부 함수가 되었습니다.

코스 라우팅과 리뷰 카드 계약

Layer / File(s) Summary
코스 라우팅과 리뷰 카드 계약
src/components/common/CourseReviewCard.tsx, src/utils/reviewCard.ts, src/pages/home/components/ReviewSection.tsx, src/pages/recent-review-courses/index.tsx, src/hooks/useCourses.ts, tests/review-card-mapper.test.ts
리뷰의 courseTypecourseId로 코스 상세 경로를 직접 생성합니다. CourseReviewCardtransport를 표시합니다. 리뷰 카드 매핑 결과와 성별 메타 라벨 테스트를 갱신했습니다.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ReviewCard
  participant ReviewPage
  participant useReviewEdit
  participant ReviewEditModal

  ReviewCard->>ReviewPage: onEditClick(review)
  ReviewPage->>useReviewEdit: requestEdit(review)
  useReviewEdit-->>ReviewPage: editorProps
  ReviewPage->>ReviewEditModal: editorProps 전달
Loading

Possibly related PRs

  • yeogido/frontend#243: 리뷰 수정 흐름과 ReviewEditModal, useUpdateReview를 함께 변경합니다.
  • yeogido/frontend#227: 리뷰 카드, 코스 리뷰 페이지, 리뷰 타입을 공유합니다.
  • yeogido/frontend#103: 리뷰 카드의 courseType, transport, 이미지 데이터를 공유합니다.

Suggested reviewers: kimtaehyeokkkk

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 57.14% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed [#262] 이미지 스키마, imageKey 기반 수정, courseType 라우팅, gender 메타 반영 요구를 모두 충족합니다.
Out of Scope Changes check ✅ Passed 변경 사항은 후기 API 반영, 후기 수정 진입, 상세 이동, 타입 및 테스트 갱신 범위에 포함됩니다.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 코스 후기 API 응답 변경을 반영한다는 제목이 이미지 스키마, 작성자 메타, 후기 수정 및 경로 변경을 포함한 주요 변경사항을 명확히 요약합니다.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/review-course-type

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@junehuk junehuk changed the title Feature/review course type [FEAT] 코스 후기 API 응답 변경 반영 Aug 6, 2026
@junehuk

junehuk commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/hooks/useReviews.ts`:
- Around line 251-255: Update the comment above the review-edit hook usage to
state that editing is supported from home, recent reviews, course detail, and
the full review view; remove the outdated claim that course review lists lack
imageKey and cannot identify retained photos. Keep the implementation unchanged.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: f69dfd86-48c9-442e-a0c1-1f5628493572

📥 Commits

Reviewing files that changed from the base of the PR and between c50977f and c8f18d1.

📒 Files selected for processing (16)
  • src/components/common/CourseReviewCard.tsx
  • src/components/common/ReviewEditModal.tsx
  • src/hooks/useCourses.ts
  • src/hooks/useReviews.ts
  • src/pages/course-reviews/index.tsx
  • src/pages/detail/components/CourseDetailLayout.tsx
  • src/pages/detail/components/DetailReviewSection.tsx
  • src/pages/detail/constants/courseDetailMock.ts
  • src/pages/detail/mappers/courseReviewMapper.ts
  • src/pages/detail/types/courseDetail.ts
  • src/pages/home/components/ReviewSection.tsx
  • src/pages/recent-review-courses/index.tsx
  • src/types/review.type.ts
  • src/utils/reviewCard.ts
  • tests/course-review-mapper.test.ts
  • tests/review-card-mapper.test.ts
📜 Review details
🧰 Additional context used
🧠 Learnings (6)
📚 Learning: 2026-07-26T17:09:23.387Z
Learnt from: KJun-2
Repo: yeogido/frontend PR: 125
File: src/pages/local-recommendation/course-basic-info/components/CompanionSelector.tsx:82-90
Timestamp: 2026-07-26T17:09:23.387Z
Learning: 이 프로젝트의 반응형 스케일 정책에서는 텍스트(폰트) 크기를 설계 기준 값에 전역 `scale`을 곱해 비율대로 스케일하세요. `12px`, `14px`처럼 특정 최소 하한을 강제로 적용하거나(클램프/바닥값) 임의의 픽셀 값으로 제한하지 마세요. 즉, 기준값(디자인 스펙) × `scale` 방식으로 계산해 비율이 유지되도록 구현합니다.

Applied to files:

  • src/components/common/ReviewEditModal.tsx
  • src/pages/detail/components/CourseDetailLayout.tsx
  • src/components/common/CourseReviewCard.tsx
  • src/pages/home/components/ReviewSection.tsx
  • src/pages/course-reviews/index.tsx
  • src/pages/recent-review-courses/index.tsx
  • src/pages/detail/components/DetailReviewSection.tsx
📚 Learning: 2026-08-03T09:41:11.931Z
Learnt from: KJun-2
Repo: yeogido/frontend PR: 188
File: src/pages/detail/components/CourseDetailLayout.tsx:202-205
Timestamp: 2026-08-03T09:41:11.931Z
Learning: When implementing the shared back-navigation UI component in yeogido/frontend, manage all UI dimensions, including positional offsets, according to the project’s global `scale` policy so the component remains visually consistent across screens.

Applied to files:

  • src/components/common/ReviewEditModal.tsx
  • src/pages/detail/components/CourseDetailLayout.tsx
  • src/components/common/CourseReviewCard.tsx
  • src/pages/home/components/ReviewSection.tsx
  • src/pages/course-reviews/index.tsx
  • src/pages/recent-review-courses/index.tsx
  • src/pages/detail/components/DetailReviewSection.tsx
📚 Learning: 2026-07-26T17:09:27.685Z
Learnt from: KJun-2
Repo: yeogido/frontend PR: 125
File: src/pages/local-recommendation/course-basic-info/components/TransportSelector.tsx:84-91
Timestamp: 2026-07-26T17:09:27.685Z
Learning: In this project’s 390px-based continuous responsive scaling, do not apply an artificial minimum lower bound to text sizes (e.g., avoid clamping via Math.max/min-font-size patterns). Instead, compute typography using proportional ratio scaling: render font sizes as `VALUE * scale` (for example, `DESCRIPTION_FONT_SIZE * scale`). During review, flag any code that enforces a hard minimum text size that breaks the intended proportional scaling.

Applied to files:

  • src/components/common/ReviewEditModal.tsx
  • src/pages/detail/components/CourseDetailLayout.tsx
  • src/components/common/CourseReviewCard.tsx
  • src/pages/home/components/ReviewSection.tsx
  • src/pages/course-reviews/index.tsx
  • src/pages/recent-review-courses/index.tsx
  • src/pages/detail/components/DetailReviewSection.tsx
📚 Learning: 2026-07-26T17:09:32.991Z
Learnt from: KJun-2
Repo: yeogido/frontend PR: 125
File: src/pages/local-recommendation/tag-selection/components/KeywordSelectionSection.tsx:51-56
Timestamp: 2026-07-26T17:09:32.991Z
Learning: When implementing responsive scaling in this project, prefer direct proportional calculations (e.g., using `VALUE * scale`) without applying artificial minimum lower bounds (clamps) to text sizes or other visual dimensions. Only introduce a lower bound when there is an explicitly documented exception; the primary allowed example is enforcing a 44px minimum touch target for interactive elements. In review, flag new/minimum clamps for text/visual dimensions unless they match an explicitly documented exception.

Applied to files:

  • src/components/common/ReviewEditModal.tsx
  • src/pages/detail/components/CourseDetailLayout.tsx
  • src/components/common/CourseReviewCard.tsx
  • src/pages/home/components/ReviewSection.tsx
  • src/pages/course-reviews/index.tsx
  • src/pages/recent-review-courses/index.tsx
  • src/pages/detail/components/DetailReviewSection.tsx
📚 Learning: 2026-07-26T17:09:40.303Z
Learnt from: KJun-2
Repo: yeogido/frontend PR: 125
File: src/pages/local-recommendation/tag-selection/components/RepresentativePhotoSection.tsx:107-122
Timestamp: 2026-07-26T17:09:40.303Z
Learning: yeogido/frontend의 반응형 스케일 정책에 맞춰, 텍스트를 포함한 UI 치수는 (디자인 기준값) × 전역 `scale`로 “연속적으로” 계산하고, 12px·14px 같은 최소 폰트/사이즈 하한(floor) 클램프를 적용하지 않는다. `scaleValue`를 쓰더라도 텍스트에 임의의 minimum floor를 추가하거나 `Math.max(value, 12/14)` 같은 보정을 넣지 말 것.

Applied to files:

  • src/components/common/ReviewEditModal.tsx
  • src/pages/detail/components/CourseDetailLayout.tsx
  • src/components/common/CourseReviewCard.tsx
  • src/pages/home/components/ReviewSection.tsx
  • src/pages/course-reviews/index.tsx
  • src/pages/recent-review-courses/index.tsx
  • src/pages/detail/components/DetailReviewSection.tsx
📚 Learning: 2026-07-09T14:49:12.548Z
Learnt from: kimtaehyeokkkk
Repo: yeogido/frontend PR: 18
File: src/components/common/ReviewCard.tsx:21-36
Timestamp: 2026-07-09T14:49:12.548Z
Learning: In `FestivalSection.tsx`, `CourseSection.tsx`, and `ReviewSection.tsx` under `src/pages/home/components/`, keep the local `isLoading` toggle as an intentional UI-only control for verifying skeleton/placeholder states. Do not flag `isLoading` as an issue for not being derived from real data fetching until the planned React Query migration; only raise concerns if the toggle is misused in a way that breaks the UI (e.g., it doesn’t control the intended skeleton/placeholder rendering or is clearly dead/unused code).

Applied to files:

  • src/pages/home/components/ReviewSection.tsx
🔇 Additional comments (15)
src/types/review.type.ts (1)

17-24: LGTM!

Also applies to: 68-76, 116-119

src/utils/reviewCard.ts (1)

14-14: LGTM!

Also applies to: 24-26, 54-54, 71-71, 80-80

src/pages/detail/mappers/courseReviewMapper.ts (1)

2-2: LGTM!

Also applies to: 20-21

src/pages/detail/types/courseDetail.ts (1)

21-22: LGTM!

src/pages/detail/constants/courseDetailMock.ts (1)

68-68: LGTM!

Also applies to: 79-79

tests/course-review-mapper.test.ts (1)

6-55: LGTM!

Also applies to: 71-82, 97-100

src/components/common/ReviewEditModal.tsx (1)

106-107: LGTM!

src/pages/course-reviews/index.tsx (1)

10-10: LGTM!

Also applies to: 23-23, 101-101, 215-215, 240-241

src/pages/detail/components/CourseDetailLayout.tsx (1)

25-25: LGTM!

Also applies to: 38-38, 125-125, 339-339, 360-361

src/pages/detail/components/DetailReviewSection.tsx (1)

30-30: LGTM!

Also applies to: 40-40, 141-143

src/components/common/CourseReviewCard.tsx (1)

24-25: LGTM!

Also applies to: 48-48, 88-88

src/hooks/useCourses.ts (1)

108-112: LGTM!

Also applies to: 127-135, 167-167

src/pages/home/components/ReviewSection.tsx (1)

12-13: LGTM!

Also applies to: 21-21, 46-49, 164-164, 209-209

src/pages/recent-review-courses/index.tsx (1)

2-2: LGTM!

Also applies to: 13-13, 27-27, 57-59, 75-78, 167-167, 187-187, 205-205

tests/review-card-mapper.test.ts (1)

13-19: LGTM!

Also applies to: 51-66, 77-81

Comment thread src/hooks/useReviews.ts
코스별 후기 응답에도 imageKey가 오면서 네 화면 모두 수정에 들어갈 수 있게
됐는데, 두 곳에만 있다고 설명하는 주석이 남아 있었다.

@yoonsunmindd yoonsunmindd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

화면 다 확인 했습니다! 수고하셨습니다

Image Image Image Image Image

@junehuk
junehuk merged commit 1215aa6 into develop Aug 6, 2026
3 checks passed
@junehuk
junehuk deleted the feature/review-course-type branch August 6, 2026 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] 코스 후기 백엔드 변경 반영

2 participants