Skip to content

[캠퍼스] 콜밴팟 API 이미지 업로드 추가#1209

Merged
dooohun merged 4 commits intodevelopfrom
feat/1183/image-upload-api
Mar 17, 2026
Merged

[캠퍼스] 콜밴팟 API 이미지 업로드 추가#1209
dooohun merged 4 commits intodevelopfrom
feat/1183/image-upload-api

Conversation

@dooohun
Copy link
Contributor

@dooohun dooohun commented Mar 14, 2026

What is this PR? 🔍

Changes 📝

  • 서버에서 미추가했던 이미지 요청값 추가 및 UI 반영
  • 일부 깨진 UI 변경
  • upload API 도메인 CALLVAN_CHAT CALLVAN_REPORT 추가 및 반영

Test CheckList ✅

  • 이미지 업로드 확인
  • 채팅 업로드 확인

Precaution

N/A

✔️ Please check if the PR fulfills these requirements

  • It's submitted to the correct branch, not the develop branch unconditionally?
  • If on a hotfix branch, ensure it targets main?
  • There are no warning message when you run yarn lint

Summary by CodeRabbit

릴리스 노트

  • 새로운 기능

    • 보고서와 채팅에 이미지 첨부 기능 추가 — 제출 시 이미지들을 함께 전송 가능
    • 업로드 진행 중에는 제출 버튼이 비활성화되어 중복 제출 방지
    • 업로드 실패 시 사용자에게 알림 표시 및 제출 중단
  • 스타일

    • 이미지 업로드 버튼 높이 개선 (사용성 향상)

@dooohun dooohun self-assigned this Mar 14, 2026
@dooohun dooohun added the ✨ Feature 기능 개발 label Mar 14, 2026
@coderabbitai
Copy link

coderabbitai bot commented Mar 14, 2026

개요

이 변경사항은 Callvan 리포트에 이미지 첨부 기능을 추가합니다. 새로운 첨부 파일 타입과 첨부 배열 필드를 도입하고, 업로드 도메인을 확장하며, 리포트 제출 시 이미지 업로드를 비동기로 수행해 업로드된 URL을 attachments로 포함하도록 구현합니다.

변경사항

Cohort / File(s) 요약
API 엔티티 타입 정의
src/api/callvan/entity.ts, src/api/uploadFile/entity.ts
CallvanReportAttachmentType = 'IMAGE'CallvanReportAttachment 인터페이스 추가. CallvanReportRequestattachments?: CallvanReportAttachment[] 필드 추가. UploadDomainCALLVAN_REPORT, CALLVAN_CHAT 도메인 추가.
리포트 페이지 UI 및 스타일
src/components/Callvan/components/ReportPage/ReportPage.module.scss, src/components/Callvan/components/ReportPage/DetailStep.tsx
리포트 이미지 버튼 높이를 38px로 고정. DetailStep에서 불필요한 주석 라인 제거.
업로드 도메인 변경 (채팅)
src/components/Callvan/components/CallvanChatRoom/index.tsx
채팅 이미지 업로드 도메인을 'SHOPS'에서 'CALLVAN_CHAT'로 변경.
리포트 제출 로직 확장
src/components/Callvan/components/ReportPage/index.tsx
useUploadFile 훅 통합. 제출 시 이미지들을 비동기 업로드하고, 실패 시 Toast 표시 후 제출 중단. 업로드된 URL들을 {attachment_type:'IMAGE', url} 형태로 payload의 attachments에 포함. handleSubmit을 async로 변환하고 제출 버튼 비활성화 조건에 isUploading 추가.

시퀀스 다이어그램

sequenceDiagram
    participant User as 사용자
    participant React as ReportPage<br/>(컴포넌트)
    participant Hook as useUploadFile<br/>(훅)
    participant API as Upload API
    participant Server as 서버

    User->>React: 이미지 선택 및 제출
    React->>React: 선택된 이미지 확인
    React->>Hook: 각 이미지에 대해 uploadFile() 호출 (병렬)
    Hook->>API: 이미지 업로드 요청 (CALLVAN_REPORT 도메인)
    API->>Server: 파일 전송
    Server-->>API: 업로드된 URL 반환
    API-->>Hook: URL 응답 전달
    Hook-->>React: 모든 업로드 완료 통보
    React->>React: attachment 객체 생성 ({attachment_type:'IMAGE', url})
    React->>Server: 리포트 제출 (attachments 포함)
    Server-->>React: 제출 완료 응답
    React-->>User: 성공 알림
Loading

예상 코드 리뷰 노력

🎯 3 (보통) | ⏱️ ~20분

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 제목이 주요 변경사항을 명확하게 설명하고 있습니다. 콜밴팟 API에 이미지 업로드 기능이 추가되었으며, 제목이 이를 정확히 반영합니다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/1183/image-upload-api
📝 Coding Plan
  • Generate coding plan for human review comments

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 and usage tips.

Tip

CodeRabbit can use oxc to improve the quality of JavaScript and TypeScript code reviews.

Add a configuration file to your project to customize how CodeRabbit runs oxc.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/components/Callvan/components/ReportPage/index.tsx (1)

138-140: 업로드/제출 중 로딩 상태 피드백을 고려해 보세요.

버튼이 isPending || isUploading 상태에서 비활성화되는 것은 좋습니다. 다만, 사용자에게 현재 작업 중임을 시각적으로 알려주면 UX가 개선됩니다.

♻️ 로딩 상태 표시 예시
-          <button type="button" className={styles['page__submit-button']} onClick={handleSubmit} disabled={isPending || isUploading}>
-            신고하기
+          <button 
+            type="button" 
+            className={styles['page__submit-button']} 
+            onClick={handleSubmit} 
+            disabled={isPending || isUploading}
+            aria-busy={isPending || isUploading}
+          >
+            {isUploading ? '업로드 중...' : isPending ? '제출 중...' : '신고하기'}
           </button>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/Callvan/components/ReportPage/index.tsx` around lines 138 -
140, The submit button currently disables when isPending || isUploading but
provides no visual loading feedback; update the button rendered in ReportPage
(the element using styles['page__submit-button'] with onClick={handleSubmit}) to
show a loading state: when isPending || isUploading change the label to
something like "신고하는 중..." and add an accessible busy indicator (e.g.,
aria-busy="true" and aria-live or aria-label) and/or render a small inline
spinner/icon next to the text (use any existing LoadingSpinner component or a
CSS spinner class) so users see activity while submission/uploads occur.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/components/Callvan/components/ReportPage/index.tsx`:
- Around line 138-140: The submit button currently disables when isPending ||
isUploading but provides no visual loading feedback; update the button rendered
in ReportPage (the element using styles['page__submit-button'] with
onClick={handleSubmit}) to show a loading state: when isPending || isUploading
change the label to something like "신고하는 중..." and add an accessible busy
indicator (e.g., aria-busy="true" and aria-live or aria-label) and/or render a
small inline spinner/icon next to the text (use any existing LoadingSpinner
component or a CSS spinner class) so users see activity while submission/uploads
occur.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 0d4b06c2-b0d1-4e97-b52c-9251935ead8c

📥 Commits

Reviewing files that changed from the base of the PR and between 730dc4e and 6966138.

📒 Files selected for processing (1)
  • src/components/Callvan/components/ReportPage/index.tsx

@dooohun dooohun merged commit 47d8f4a into develop Mar 17, 2026
3 checks passed
@github-actions github-actions bot deleted the feat/1183/image-upload-api branch March 17, 2026 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ Feature 기능 개발

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants