Skip to content

fix: 이벤트 주최 API 데이터 요청값 형식 변경#115

Merged
Yejiin21 merged 5 commits intodevelopfrom
fix/#114/event-request-format
May 6, 2025
Merged

fix: 이벤트 주최 API 데이터 요청값 형식 변경#115
Yejiin21 merged 5 commits intodevelopfrom
fix/#114/event-request-format

Conversation

@Yejiin21
Copy link
Copy Markdown
Contributor

@Yejiin21 Yejiin21 commented May 5, 2025

  • 주소 좌표값 개별 변수로 변경
  • [startDate + startTime], [endDate + endTime] Date으로 데이터 보내기

이외에 작업 사항

  • 카테고리 타입 오류 수정 및 타입 단언 처리
  • 전화번호 "-" 포함하도록 placeholder 값 수정
  • 이벤트 생성 성공 시 내 호스트 페이지로 이동하도록 수정

Summary by CodeRabbit

  • 기능 개선
    • 이벤트 생성 시 위치 정보 입력 방식이 변경되어, 위도와 경도를 각각 직접 입력하도록 개선되었습니다.
    • 이벤트 카테고리 선택 시 기본값이 'DEVELOPMENT_STUDY'로 설정됩니다.
    • 날짜 및 시간 입력이 ISO 형식으로 통합되어 저장됩니다.
    • 이벤트 생성 완료 후 이동 경로가 메인 화면에서 '내가 주최한 메뉴'로 변경되었습니다.
  • UI/UX
    • 전화번호 입력란의 안내 문구가 하이픈(-) 포함 입력으로 변경되었습니다.

@Yejiin21 Yejiin21 added the 🛠️ BugFix 오류 해결 과정 기록 label May 5, 2025
@Yejiin21 Yejiin21 requested review from hyeeuncho and xaexunxang May 5, 2025 07:44
@Yejiin21 Yejiin21 self-assigned this May 5, 2025
@Yejiin21 Yejiin21 linked an issue May 5, 2025 that may be closed by this pull request
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented May 5, 2025

Walkthrough

이 변경 사항은 이벤트 생성 및 관리와 관련된 여러 파일에서 이벤트 상태의 구조와 초기값을 수정합니다. 주요 변경점으로는 이벤트 시작 및 종료 시간을 분리된 문자열에서 ISO 문자열로 통합하였고, 위치 정보는 객체에서 위도와 경도를 각각의 숫자 필드로 분리하였습니다. 이벤트 카테고리의 기본값이 명시적으로 지정되었으며, 카테고리 선택 시 타입 일관성이 강화되었습니다. 또한, 이벤트 생성 성공 시 이동하는 경로가 변경되었고, 일부 UI의 안내 문구가 수정되었습니다. 타입 정의에서도 이 구조 변경이 반영되었습니다.

Changes

파일/경로 요약 변경 요약
src/features/event-manage/event-create/model/FunnelContext.tsx 이벤트 상태의 초기값에서 startTime, endTime 제거, location 객체를 locationLat/locationLng 숫자 필드로 분리, category 기본값 지정
src/features/event-manage/event-create/ui/DatePicker.tsx startTime, endTime 기본값을 고정, 날짜 및 시간 상태를 ISO 문자열로 통합하여 setEventState에 전달, formatDate 함수 삭제
src/features/event-manage/event-create/ui/EventCategory.tsx 카테고리 선택 시 category.id에 CategoryType 타입 단언 추가, 관련 타입 import
src/features/event-manage/event-create/ui/EventFunnel.tsx 이벤트 생성 완료 후 이동 경로를 '/'에서 '/menu/myHost'로 변경
src/features/event-manage/event-create/ui/EventType.tsx KakaoMap에 전달하는 위치 값을 location 객체에서 개별 locationLat/locationLng 필드로 변경
src/pages/event-manage/ui/EventOrganizerInfoPage.tsx 전화번호 입력 안내 문구를 하이픈 포함으로 변경
src/shared/types/baseEventType.ts BaseEvent 인터페이스에서 startTime, endTime, location 객체, referenceLinks 내 주소 관련 필드 제거 및 구조 변경

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant EventCreateUI
    participant FunnelContext
    participant BaseEventType

    User->>EventCreateUI: 이벤트 정보 입력
    EventCreateUI->>FunnelContext: eventState 업데이트 (locationLat, locationLng, ISO 날짜/시간 등)
    FunnelContext->>BaseEventType: 새로운 구조 적용(BaseEvent: locationLat/locationLng, ISO 문자열)
    EventCreateUI->>EventCreateUI: 이벤트 생성 완료 시 '/menu/myHost'로 이동
Loading

Possibly related issues

Suggested labels

🔧 Feature

Poem

🐰
이벤트 구조가 바뀌었네,
시간은 ISO로, 좌표는 따로따로,
카테고리도 똑똑하게 타입을 챙기고,
주최자 안내는 하이픈도 잊지 않고!
이제 새로운 흐름 속에
토끼는 깡충, 버그는 쏙—
코드밭에 봄이 오네!


📜 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 4694f99 and fcbc585.

📒 Files selected for processing (7)
  • src/features/event-manage/event-create/model/FunnelContext.tsx (1 hunks)
  • src/features/event-manage/event-create/ui/DatePicker.tsx (2 hunks)
  • src/features/event-manage/event-create/ui/EventCategory.tsx (2 hunks)
  • src/features/event-manage/event-create/ui/EventFunnel.tsx (1 hunks)
  • src/features/event-manage/event-create/ui/EventType.tsx (1 hunks)
  • src/pages/event-manage/ui/EventOrganizerInfoPage.tsx (1 hunks)
  • src/shared/types/baseEventType.ts (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/features/event-manage/event-create/ui/EventCategory.tsx (1)
src/shared/types/baseEventType.ts (1)
  • CategoryType (2-2)
🔇 Additional comments (10)
src/pages/event-manage/ui/EventOrganizerInfoPage.tsx (1)

54-54: 전화번호 입력 안내 텍스트가 업데이트되었습니다

전화번호 입력 필드의 안내 텍스트가 하이픈 포함 형식으로 변경되었습니다. 이는 PR 목표에 언급된 하이픈을 포함한 전화번호 형식으로의 변경과 일치합니다.

src/features/event-manage/event-create/ui/EventFunnel.tsx (1)

26-26: 이벤트 생성 후 사용자 경로 개선

이벤트 생성 성공 후 루트 경로가 아닌 호스트 페이지로 리디렉션되도록 변경되었습니다. 이는 PR 목표에 언급된 대로 "이벤트 생성 성공 시 사용자의 호스트 페이지로 리디렉션"하기 위한 변경입니다.

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

83-83: 위치 데이터 구조 변경 적용

KakaoMap 컴포넌트에 전달되는 props가 location 객체에서 개별 locationLatlocationLng 값으로 변경되었습니다. 이는 PR 목표에 언급된 "주소 좌표값을 각각의 변수로 변경"한 것과 일치합니다.

src/features/event-manage/event-create/ui/EventCategory.tsx (2)

4-4: CategoryType 타입 가져오기 추가

이벤트 카테고리 타입을 명시적으로 정의하기 위해 CategoryType 가져오기가 추가되었습니다.


36-36: 카테고리 타입 단언 추가

카테고리 ID를 CategoryType으로 명시적 타입 단언하여 타입 안전성을 향상시켰습니다. 이는 PR 목표에 언급된 "타입 단언을 통한 카테고리 타입 오류 수정"과 일치합니다.

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

33-35: 이벤트 상태 구조가 개선되었습니다.

위치 정보를 객체 대신 개별 변수(locationLat, locationLng)로 분리하고 카테고리에 기본값을 설정한 것은 좋은 변경입니다. 이 구조는 API 요청 시 데이터 변환 작업을 줄이고 일관된 초기값으로 오류 가능성을 감소시킵니다.

src/shared/types/baseEventType.ts (1)

16-17: 타입 정의 변경이 적절합니다.

위치 정보를 객체에서 개별 필드로 변경한 것이 FunnelContext의 변경사항과 잘 일치합니다. 이는 API 요청 형식에 맞게 데이터 구조를 단순화하고 일관성을 유지하는 데 도움이 됩니다.

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

19-20: 시간 상태 초기화 방식이 개선되었습니다.

기본값을 항상 '06:00'과 '23:00'으로 설정하는 것은 일관된 사용자 경험을 제공합니다. 이전 코드에서는 eventState의 값에 의존하고 있었지만, 이제 명확한 기본값으로 시작합니다.


37-46: 날짜와 시간 결합 로직이 적절합니다.

Date 객체를 생성하고 선택한 시간을 설정하는 방식이 잘 구현되어 있습니다. 이 접근 방식은 PR 목표에 부합하여 날짜와 시간을 결합된 형태로 저장합니다.


49-50: ISO 문자열 형식으로의 변환이 적절합니다.

Date 객체를 ISO 문자열로 변환하여 저장하는 방식은 백엔드 API와의 일관된 통신을 가능하게 합니다. 이는 이전에 별도로 관리하던 날짜와 시간 정보를 단일 형식으로 통합하는 PR 목표를 잘 달성했습니다.

✨ 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

github-actions bot commented May 5, 2025

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 5c35287 into develop May 6, 2025
2 checks passed
@Yejiin21 Yejiin21 deleted the fix/#114/event-request-format branch May 6, 2025 12:59
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] 이벤트 주최 API 데이터 요청값 형식 변경

2 participants