Skip to content

fix: 카카오맵 지도 이미지 에러 수정#119

Merged
Yejiin21 merged 4 commits intodevelopfrom
fix/#117/kakao-map-img
May 10, 2025
Merged

fix: 카카오맵 지도 이미지 에러 수정#119
Yejiin21 merged 4 commits intodevelopfrom
fix/#117/kakao-map-img

Conversation

@Yejiin21
Copy link
Copy Markdown
Contributor

@Yejiin21 Yejiin21 commented May 10, 2025

카카오맵 주소 좌표 LocationLat, LocationLng으로 분리하여 변수값 설정하여 에러 해결했습니다.

  • 이슈 외에 수정사항
    • 대시보드 기본 정보 페이지, 상세 정보 페이지에 hostChannelId가 선언되지 않는 변수 에러 수정

Summary by CodeRabbit

  • New Features

    • 이벤트 상세 주소 입력 필드가 추가되어, 기존 주소 외에 상세 주소 정보를 별도로 입력 및 관리할 수 있습니다.
    • 오프라인 이벤트의 주소 입력 시 지도와 함께 상세 주소를 입력할 수 있는 UI가 도입되었습니다.
  • 개선사항

    • 이벤트 위치 정보(위도, 경도)가 별도 필드로 저장되어 더욱 정확한 위치 관리가 가능합니다.
    • 이벤트 저장 시 참조 링크 정보가 간소화되고, 호스트 채널 ID가 동적으로 반영됩니다.
  • 버그 수정

    • 주소 및 위치 관련 입력과 저장 과정에서의 일관성이 향상되었습니다.

@Yejiin21 Yejiin21 self-assigned this May 10, 2025
@Yejiin21 Yejiin21 added the 🛠️ BugFix 오류 해결 과정 기록 label May 10, 2025
@Yejiin21 Yejiin21 linked an issue May 10, 2025 that may be closed by this pull request
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented May 10, 2025

Walkthrough

이 변경 사항은 이벤트 생성 및 관리 기능에서 주소와 위치 정보를 더 세분화하여 관리하도록 상태 구조와 관련 컴포넌트, 타입 정의를 수정합니다. detailAddress, locationLat, locationLng 등의 필드가 추가되고, 관련 UI와 데이터 처리 로직이 이에 맞게 조정되었습니다.

Changes

파일/경로 변경 요약
src/features/event-manage/event-create/model/FunnelContext.tsx eventStatedetailAddress 속성 추가.
src/features/event-manage/event-create/ui/EventType.tsx 주소와 위치 정보를 각각 별도 필드(address, detailAddress, locationLat, locationLng)로 관리하도록 수정.
src/features/event-manage/event-create/ui/LinkInput.tsx Link 인터페이스에서 address, detailAddress 필드 제거 및 관련 초기화 코드 수정.
src/pages/dashboard/ui/EventDetailPage.tsx hostChannelId 상태 추가 및 이벤트 저장 시 해당 값 사용, referenceLinks 매핑 명확화, mutate 호출 방식 개선.
src/pages/dashboard/ui/EventInfoPage.tsx 주소 입력 UI를 AddressSearchKakaoMap으로 교체, 위치 및 상세 주소 상태 추가, 저장 로직 및 초기화 개선.
src/shared/lib/formatEventRequest.ts 반환 객체에서 location 객체를 분리하여 detailAddress, locationLat, locationLng 속성으로 변경.
src/shared/types/baseEventType.ts BaseEvent 인터페이스에 detailAddress 속성 추가.
src/shared/ui/AddressSearch.tsx detailAddress prop 추가 및 prop 변화 감지하여 내부 상태 동기화 로직 추가.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant EventInfoPage
    participant AddressSearch
    participant KakaoMap
    participant Backend

    User->>EventInfoPage: 이벤트 정보 입력/수정
    EventInfoPage->>AddressSearch: 주소 및 상세주소 입력 요청
    AddressSearch-->>EventInfoPage: address, detailAddress 반환
    EventInfoPage->>KakaoMap: locationLat, locationLng 전달
    KakaoMap-->>EventInfoPage: 위치 지도 표시
    User->>EventInfoPage: 저장 클릭
    EventInfoPage->>Backend: address, detailAddress, locationLat, locationLng 등 포함하여 저장 요청
    Backend-->>EventInfoPage: 저장 결과 응답
Loading

Suggested reviewers

  • hyeeuncho
  • xaexunxang

Poem

🐰
주소 한 칸 더 늘어나
상세하게 쏙쏙 담아요!
지도 위에 토끼 뛰고
채널 ID도 챙겼죠.
이벤트 관리, 이제 완벽!
깡총깡총 코딩의 봄,
변화 속에 웃음꽃~ 🌸

Tip

⚡️ Faster reviews with caching
  • CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.

Enjoy the performance boost—your workflow just got faster.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 359d35b and e8341c2.

📒 Files selected for processing (8)
  • src/features/event-manage/event-create/model/FunnelContext.tsx (1 hunks)
  • src/features/event-manage/event-create/ui/EventType.tsx (1 hunks)
  • src/features/event-manage/event-create/ui/LinkInput.tsx (0 hunks)
  • src/pages/dashboard/ui/EventDetailPage.tsx (2 hunks)
  • src/pages/dashboard/ui/EventInfoPage.tsx (4 hunks)
  • src/shared/lib/formatEventRequest.ts (1 hunks)
  • src/shared/types/baseEventType.ts (1 hunks)
  • src/shared/ui/AddressSearch.tsx (1 hunks)
💤 Files with no reviewable changes (1)
  • src/features/event-manage/event-create/ui/LinkInput.tsx
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/pages/dashboard/ui/EventDetailPage.tsx (1)
src/features/event-manage/event-create/ui/LinkInput.tsx (1)
  • Link (13-16)
🔇 Additional comments (19)
src/shared/types/baseEventType.ts (1)

16-16: BaseEvent 인터페이스에 detailAddress 필드가 추가되었습니다.

주소 정보를 더 세부적으로 관리하기 위해 상세 주소 필드가 추가된 것은 좋은 접근 방식입니다. 이는 카카오맵 이미지 오류 해결에도 도움이 됩니다.

src/features/event-manage/event-create/model/FunnelContext.tsx (1)

33-33: 이벤트 상태에 detailAddress 필드가 올바르게 초기화되었습니다.

FunnelContext의 eventState에 detailAddress 필드가 빈 문자열로 초기화되어 추가되었습니다. 이는 BaseEvent 인터페이스의 변경사항과 일관성 있게 적용되었습니다.

src/shared/lib/formatEventRequest.ts (1)

12-14: 위치 정보 구조가 개선되었습니다.

중첩된 location 객체 대신 개별 필드(detailAddress, locationLat, locationLng)로 분리한 것은 좋은 개선입니다. 이렇게 변경함으로써 카카오맵 이미지 오류가 해결되고, 데이터 구조가 더 명확해졌습니다.

src/shared/ui/AddressSearch.tsx (3)

5-11: AddressSearchProps 인터페이스에 detailAddress 속성이 추가되었습니다.

상세 주소를 위한 선택적 속성이 올바르게 추가되었습니다. 이는 주소 정보를 더 세부적으로 관리하기 위한 변경사항과 일관성이 있습니다.


13-19: 컴포넌트 매개변수에 detailAddress가 포함되었습니다.

컴포넌트 매개변수 목록에 initialDetailAddress라는 이름으로 detailAddress가 추가되고 기본값이 빈 문자열로 설정되었습니다. 이러한 접근 방식은 적절합니다.


24-26: useEffect를 사용하여 detailAddress 상태를 동기화합니다.

useEffect 훅을 사용하여 외부에서 전달된 detailAddress 속성 값이 변경될 때 내부 상태를 업데이트하는 것은 React의 제어 컴포넌트 패턴에 맞는 올바른 구현입니다.

src/features/event-manage/event-create/ui/EventType.tsx (3)

28-30: 주소 데이터 구조 개선이 잘 이루어졌습니다.

주소와 상세주소를 별도의 필드로 분리해서 저장하는 방식으로 변경되었습니다. 이는 더 명확한 데이터 관리와 UI 표시에 적합합니다.


37-39: 주소 데이터 구조가 일관되게 적용되었습니다.

상세주소 변경 핸들러에서도 동일한 패턴으로 address와 detailAddress를 별도로 저장하도록 변경되었습니다. 일관된 코드 스타일이 잘 유지되었습니다.


42-48: 위치 좌표 처리 방식이 개선되었습니다.

함수 매개변수 이름이 보다 명시적인 locationLat, locationLng로 변경되었고, 위치 정보를 별도의 스칼라 값으로 저장하는 방식으로 개선되었습니다. 이로 인해 코드의 가독성이 향상되고 관련 데이터에 보다 직접적으로 접근할 수 있게 되었습니다.

src/pages/dashboard/ui/EventDetailPage.tsx (4)

17-17: hostChannelId 상태 변수가 적절히 추가되었습니다.

이제 hostChannelId가 0으로 초기화된 상태 변수로 제대로 선언되었습니다. 이는 PR 목표에서 언급된 hostChannelId 관련 변수 선언 오류를 수정합니다.


24-24: 데이터에서 hostChannelId를 올바르게 설정합니다.

API 응답에서 hostChannelId를 가져와 상태를 업데이트하고, 값이 없는 경우 기본값 0을 사용합니다. 이로써 상태가 일관되게 관리됩니다.


36-42: mutation 페이로드 구조가 개선되었습니다.

mutation 페이로드가 명확하게 구조화되었습니다. 특히:

  1. 하드코딩된 값 대신 hostChannelId 상태 변수를 사용
  2. referenceLinks에서 필요한 필드(title, url)만 명시적으로 추출

이런 방식은 API 호출을 더 안정적이고 예측 가능하게 만듭니다.


43-51: mutate 호출 패턴이 개선되었습니다.

mutate 함수 호출이 보다 구조화된 방식으로 리팩토링되었습니다. 콜백 함수들(onSuccess, onError)을 옵션 객체에 직접 전달하는 방식으로 변경되어 코드의 가독성과 유지보수성이 향상되었습니다.

src/pages/dashboard/ui/EventInfoPage.tsx (6)

12-13: 필요한 컴포넌트가 적절히 추가되었습니다.

주소 검색과 지도 표시를 위한 컴포넌트가 추가되었습니다. 이는 카카오맵 이미지 오류를 해결하기 위한 중요한 변경사항입니다.


26-27: 위치 관련 상태 변수들이 적절히 정의되었습니다.

hostChannelId, detailAddress, locationLat, locationLng 상태 변수들이 추가되었습니다. 이는 PR 목표에서 언급된 대로:

  1. hostChannelId 변수 선언 오류 수정
  2. 주소 좌표를 두 개의 변수(LocationLat, LocationLng)로 분리

이러한 변경으로 위치 데이터가 더 명확하게 관리됩니다.

Also applies to: 32-35


41-44: 날짜 형식 변환 함수가 적절히 구현되었습니다.

날짜와 시간을 ISO 형식의 문자열로 변환하는 헬퍼 함수가 잘 구현되었습니다. 이를 통해 API 요청에 일관된 날짜/시간 형식을 사용할 수 있습니다.


48-59: API 요청 데이터 구조가 개선되었습니다.

API 요청 데이터에 다음 항목들이 적절히 포함되었습니다:

  1. hostChannelId
  2. ISO 형식으로 변환된 날짜/시간
  3. 분리된 주소 관련 필드(address, detailAddress)
  4. 위치 좌표(locationLat, locationLng)

이 변경으로 서버에 더 정확하고 일관된 데이터를 전송할 수 있게 되었습니다.


75-85: 상태 초기화 로직이 적절히 구현되었습니다.

useEffect 내에서 API 응답 데이터를 사용하여 상태를 초기화하는 로직이 잘 구현되었습니다. 특히:

  1. hostChannelId가 적절히 초기화됨
  2. 주소 관련 필드들(address, detailAddress)이 분리되어 초기화됨
  3. 위치 좌표(locationLat, locationLng)가 각각 초기화됨

이를 통해 데이터 일관성이 유지됩니다.


125-138: 주소 검색 및 지도 표시 UI가 개선되었습니다.

오프라인 이벤트를 위한 주소 입력 및 지도 표시 UI가 적절히 구현되었습니다:

  1. AddressSearch 컴포넌트에 필요한 prop들이 전달됨
  2. 위치 변경 시 locationLat과 locationLng 상태가 업데이트됨
  3. 유효한 좌표가 있을 때만 지도가 표시됨 (locationLat !== 0 && locationLng !== 0)

이러한 변경으로 카카오맵 이미지 오류를 해결하고 사용자 경험을 개선했습니다.

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions
Copy link
Copy Markdown

Copy link
Copy Markdown
Member

@hyeeuncho hyeeuncho left a comment

Choose a reason for hiding this comment

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

수고하셨습니다

@Yejiin21 Yejiin21 merged commit 92c43d1 into develop May 10, 2025
2 checks passed
@Yejiin21 Yejiin21 deleted the fix/#117/kakao-map-img branch May 10, 2025 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🛠️ BugFix 오류 해결 과정 기록

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[fix] 카카오맵 지도 이미지 에러 수정

2 participants