-
Notifications
You must be signed in to change notification settings - Fork 0
봉사 추가 수정 #146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
봉사 추가 수정 #146
Conversation
- volunteer 타입에서 point, optional_point 속성명을 score, optional_score로 변경 - 프론트엔드에 변경된 속성명 적용 - 백엔드 API 스펙 변경에 따른 프론트엔드 코드 수정
- "모든 학년"을 "전체"로 변경 - "FRIST" 오타를 "FIRST"로 수정 - 번역의 일관성을 유지하고 오타를 수정했습니다
기존 드롭다운 방식에서 버튼 클릭 방식으로 학년 선택 방식 변경 - 전체 학년 선택 기능 추가 - 디자인 시스템 Text 컴포넌트 추가 - useVolunteerApi 훅을 사용하여 봉사 추가 API 연동 - 성공 시 모달 닫기 기능 추가
- 학년 선택 방식: Dropdown -> Button으로 변경 - '전체' 선택 시 다른 학년 선택 불가능하도록 구현 - API 연동하여 봉사 수정 기능 구현 - UI 개선 및 UX 향상
InfoCard 컴포넌트에서 직접 API를 호출하여 봉사활동을 삭제하는 대신, onDelete 콜백 함수를 통해 상위 컴포넌트에서 삭제 로직을 처리하도록 변경했습니다 - InfoCard 컴포넌트의 책임 범위를 축소하고 재사용성을 높입니다 - 상위 컴포넌트에서 삭제 로직을 중앙 집중적으로 관리하여 일관성을 유지합니다 - 삭제 아이콘 클릭 시 onDelete 콜백 함수를 호출하여 id를 전달합니다
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR refactors the volunteer add and edit functionality by replacing dropdown-based grade selection with a button-based UI. It also fixes several bugs including a typo in the gradeKoreanCalculator function ('FRIST' → 'FIRST'), updates field names to match the API response structure (point → score, optional_point → optional_score), and consolidates toast notification handling into custom hooks.
Key Changes:
- Replaced dropdown grade selection with multi-select button interface supporting up to 2 grades or '전체' (all)
- Fixed typo 'FRIST' → 'FIRST' and standardized '모든 학년' → '전체' in translation utilities
- Refactored to use custom hooks (
useAddVolunteerWork,useEditVolunteerWork) for API calls with built-in toast notifications
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| services/admin/src/utils/translate.ts | Fixed typo 'FRIST' → 'FIRST' and changed '모든 학년' → '전체' for consistency |
| services/admin/src/pages/volunteer/index.tsx | Updated property names to match API response: point → score, optional_point → optional_score |
| services/admin/src/components/volunteer/InfoCard.tsx | Removed local delete handler and unused imports, simplified to use parent's onDelete callback |
| services/admin/src/components/modals/editVolunteer.tsx | Replaced dropdown grade selection with button-based UI, integrated custom hook for API calls |
| services/admin/src/components/modals/AddVolunteer.tsx | Replaced dropdown grade selection with button-based UI, integrated custom hook for API calls |
| services/admin/src/apis/volunteers/response.ts | Updated interface field names: point → score, optional_point → optional_score |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- 숫자 입력 시 불필요한 공백 제거
- 봉사 수정 모달에서 전체 학년 선택 조건 변경 ("ALL" 문자열 포함)
개요
봉사 추가 및 수정 시 학년 선택 기능을 변경 했습니다.
기존 코드에 잘못 작성된 부분을 제거 및 수정 했습니다.
이슈 번호
변경사항
봉사 추가 및 수정 코드