Skip to content

지역 목록 API 전환 및 '-' 포함 지역 필터링#716

Draft
hyejj19 wants to merge 1 commit intomainfrom
feature/country-api-fetch
Draft

지역 목록 API 전환 및 '-' 포함 지역 필터링#716
hyejj19 wants to merge 1 commit intomainfrom
feature/country-api-fetch

Conversation

@hyejj19
Copy link
Copy Markdown
Collaborator

@hyejj19 hyejj19 commented Apr 5, 2026

요약

  • 하드코딩된 REGIONS 상수를 /regions API 응답 기반으로 전환
  • korName-가 포함된 하위 지역(예: 스코틀랜드-캠벨타운)을 필터링하여 제거
  • "국가(전체)" 옵션은 프론트엔드에서 직접 추가

변경 사항

  • constants/common.ts에서 REGIONS 상수 제거
  • useRegionsQuery 훅 신규 생성 (TanStack Query, 24시간 캐시)
  • transformRegions(): 전체 센티넬 추가 + - 포함 지역 필터링
  • toRegionOptions(): OptionSelect UI용 변환 함수 추가
  • RegionResponseparentId 필드 추가
  • ExploreSearchBar, Search, MyBottle 페이지 API 데이터 사용으로 전환
  • transformer 및 API 단위 테스트 추가

테스트

  • pnpm test -- --testPathPattern="src/api/alcohol" 전체 통과 (20 tests)
  • 검색 페이지에서 지역 필터 동작 확인
  • ExploreSearchBar 사이드 필터 동작 확인
  • 마이보틀 페이지 지역 필터 동작 확인

🤖 Generated with Claude Code

…ions

- Remove hardcoded REGIONS constant from constants/common.ts
- Fetch regions from /regions API via useRegionsQuery hook
- Add transformRegions() to prepend '국가(전체)' sentinel and filter out
  regions containing '-' in korName
- Add toRegionOptions() for OptionSelect UI conversion
- Update ExploreSearchBar, Search, MyBottle pages to use API data
- Add RegionResponse.parentId field
- Add comprehensive unit tests for transformers and API

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

1 participant