Skip to content

Conversation

@HopeFullee
Copy link
Member

@HopeFullee HopeFullee commented Dec 23, 2025

📝 변경 사항

  • 모임 수정 API hook 작업
  • 모임 수정 페이지 nest layout 작업
    • 모임의 생성자, 수정 가능한 모임인지 여부를 판단해서 redirect 처리
    • 기존 모임 data prefech 적용
  • 모임 수정 페이지 작업
    • 기존 모임 data fetching 이후 Form의 default value로 적용

🔗 관련 이슈

Closes #


🧪 테스트 방법

  • 수동 테스트 검증(로컬 환경)
  • 유닛 테스트 검증
  • 통합 테스트 검증

📸 스크린샷 (선택)


📋 체크리스트

  • 관련 문서를 업데이트했습니다 (필요한 경우)
  • 테스트를 추가/수정했습니다 (필요한 경우)
  • Breaking change가 있다면 명시했습니다

💬 추가 코멘트


CodeRabbit Review는 자동으로 실행되지 않습니다.

Review를 실행하려면 comment에 아래와 같이 작성해주세요

@coderabbitai review

Summary by CodeRabbit

릴리스 노트

  • 새로운 기능

    • 그룹 편집 기능 추가
    • 그룹 생성 및 편집 시 참여 정책(무료/승인) 설정 옵션 추가
    • 그룹 상세 페이지 편집 UI 구현
  • 개선사항

    • 그룹 관련 API 엔드포인트 통합으로 일관성 향상
    • 그룹 참여, 탈퇴, 삭제, 상세 조회 등 기능 안정화

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 23, 2025

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

그룹 서비스 API 인터페이스를 재설계하여 라우트 매개변수 처리를 정규화했습니다. GroupIdPayloadGroupIdParams로 이름 변경하고, 새로운 editGroup 메서드를 추가했습니다. 그룹 수정 기능을 위한 새 페이지와 레이아웃 컴포넌트, 관련 훅 및 스키마를 도입했습니다.

Changes

Cohort / File(s) 변경 사항
API 서비스 및 타입
src/api/service/group-service/index.ts, src/types/service/group.ts
GroupIdPayloadGroupIdParams 이름 변경; getGroupDetails, attendGroup, leaveGroup, deleteGroup 메서드 서명 업데이트(payload → params); 새로운 editGroup(params, payload) 메서드 추가 (PATCH /groups/{groupId}); CreateGroupPayloadjoinPolicy 필드 추가
커스텀 훅
src/hooks/use-group/use-group-attend/index.ts, src/hooks/use-group/use-group-delete/index.ts, src/hooks/use-group/use-group-get-details/index.ts, src/hooks/use-group/use-group-leave/index.ts
GroupIdPayloadGroupIdParams 임포트 및 파라미터 이름 변경; API 호출 및 캐시 무효화 시 params 사용으로 업데이트
새로운 편집 훅
src/hooks/use-group/use-group-edit/index.ts
새로운 useEditGroup(params) 훅 추가; API.groupService.editGroup 호출 및 React Query 뮤테이션 기반 구현
스키마 및 폼
src/lib/schema/group.ts, src/app/post-meetup/page.tsx
createGroupSchemajoinPolicy: 'FREE' | 'APPROVE' 필드 추가; defaultValuesjoinPolicy: 'FREE' 추가; 폼 제출 시 스프레드 연산자 제거
새로운 편집 레이아웃
src/app/post-meetup/[groupId]/layout.tsx
비동기 레이아웃 컴포넌트 추가; 그룹 세부사항 조회, 호스트 여부 확인, 비호스트 완료 그룹 리다이렉트 처리
새로운 편집 페이지
src/app/post-meetup/[groupId]/page.tsx
새로운 클라이언트 페이지 컴포넌트 추가; 기존 그룹 정보 로드, 편집 폼 초기화, 이미지 변환, useEditGroup 뮤테이션 활용

Sequence Diagram(s)

sequenceDiagram
    participant User as User
    participant Layout as EditMeetupLayout
    participant Page as EditMeetupPage
    participant API as Group API
    participant QueryClient as React Query
    participant Router as Next.js Router

    User->>Layout: 요청 /post-meetup/[groupId]
    Layout->>Layout: 라우트 params 추출
    Layout->>API: getGroupDetails(params)
    API-->>Layout: 그룹 세부정보
    Layout->>Layout: 호스트 여부 확인
    alt 비호스트 && 완료됨
        Layout->>Router: redirect(/post-meetup)
    else 호스트 || 진행 중
        Layout->>QueryClient: dehydrate & hydrate
        Layout-->>Page: children with hydrated state
        Page->>Page: groupId 추출
        Page->>QueryClient: useGetGroupDetails(params)
        QueryClient-->>Page: 기존 그룹 정보
        Page->>Page: 폼 기본값 설정
        User->>Page: 폼 수정 및 제출
        Page->>API: editGroup(params, payload)
        API-->>Page: CreateGroupResponse
        Page->>QueryClient: 캐시 무효화
        Page->>Router: replace(/groups/[id])
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • WeGo-Together/WeGo_FrontEnd#205: createGroupSchemaCreateGroupFormValuesjoinPolicy 필드가 함께 추가되었으며, post-meetup 페이지의 폼 기본값 처리 방식이 수정되었습니다.

Suggested reviewers

  • wooktori

🐰 그룹을 편집하며 기쁨이 넘쳐
params로 경로를 단정하고
joinPolicy 필드도 말끔하게 🎉
완료된 그룹은 접근 차단하고
React Query로 캐시 새로이!

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목이 변경 사항의 핵심을 정확하게 반영하고 있습니다. '모임 수정 페이지 작업'은 이 PR의 주요 목표인 meeting edit 페이지 구현을 명확하게 설명합니다.
Description check ✅ Passed PR 설명에서 주요 변경 사항들이 명확하게 문서화되어 있으며, API hook, nested layout, edit 페이지 구현 등 모든 주요 작업이 설명되어 있습니다. 템플릿의 대부분 섹션이 채워져 있습니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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.

@HopeFullee HopeFullee added the Ready For Review! 리뷰 받을 준비가 되었습니다. label Dec 23, 2025
@github-actions
Copy link

github-actions bot commented Dec 23, 2025

🎭 Playwright Report

E2E Test가 성공적으로 완료되었습니다.

Test 요약 내용을 확인해주세요.

Status Build Log Updated (UTC)
✅ Ready View Build 2025-12-23 10:13:42

📊 Test Summary

  • ✅ Passed: 3
  • ❌ Failed: 0
  • ⏱️ Duration: 27.1s

📜 Test Details

✅ Passed Tests (3)
  • profile.test.ts (3)
    • [chromium] 존재하지 않는 프로필 페이지로 접속 시 404 redirect 되는 지 테스트
    • [firefox] 존재하지 않는 프로필 페이지로 접속 시 404 redirect 되는 지 테스트
    • [webkit] 존재하지 않는 프로필 페이지로 접속 시 404 redirect 되는 지 테스트

@github-actions
Copy link

github-actions bot commented Dec 23, 2025

🎨 Storybook Report

변경 사항이 없습니다

모든 Story가 이전 빌드와 동일합니다.

Status Storybook Build Log Updated (UTC)
✅ Unchanged View Storybook View Build 2025-12-23 10:12:50

@github-actions
Copy link

github-actions bot commented Dec 23, 2025

📊 Coverage Report

Status Build Log Updated (UTC)
✅ Ready View Build 2025-12-23 10:12:23

📉 #231main에 병합하면 coverage가 0.12% 감소합니다.

Coverage 요약

@@             Coverage Diff             @@
##             main     #231       +/-   ##
===========================================
- Coverage   38.44%   38.32%    -0.12%     
===========================================
  Files         164      165        +1     
  Lines        7238     7266       +28     
  Branches      300      301        +1     
===========================================
+ Hits         2783     2785        +2     
+ Misses       4455     4481       +26     

영향받은 파일

파일 Coverage 변화
/home/runner/work/WeGo_FrontEnd/WeGo_FrontEnd/src/api/service/group-service/index.ts 50.72% (-0.04%) ⬇️

@github-actions
Copy link

github-actions bot commented Dec 23, 2025

🚀 PR Preview Report

Build가 성공적으로 완료되었습니다.

Preview에서 변경사항을 확인하세요.

Status Preview Build Log Updated (UTC)
✅ Ready Visit Preview View Logs 2025-12-23 10:13:28

@claudia99503
Copy link
Member

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 23, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Contributor

@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.

Actionable comments posted: 5

📜 Review details

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c47b196 and f638fb8.

📒 Files selected for processing (11)
  • src/api/service/group-service/index.ts
  • src/app/post-meetup/[groupId]/layout.tsx
  • src/app/post-meetup/[groupId]/page.tsx
  • src/app/post-meetup/page.tsx
  • src/hooks/use-group/use-group-attend/index.ts
  • src/hooks/use-group/use-group-delete/index.ts
  • src/hooks/use-group/use-group-edit/index.ts
  • src/hooks/use-group/use-group-get-details/index.ts
  • src/hooks/use-group/use-group-leave/index.ts
  • src/lib/schema/group.ts
  • src/types/service/group.ts
🧰 Additional context used
🧬 Code graph analysis (6)
src/hooks/use-group/use-group-delete/index.ts (2)
src/types/service/group.ts (1)
  • GroupIdParams (204-206)
src/api/index.ts (1)
  • API (22-22)
src/hooks/use-group/use-group-get-details/index.ts (2)
src/types/service/group.ts (1)
  • GroupIdParams (204-206)
src/lib/query-key/query-key-group/index.ts (1)
  • groupKeys (1-10)
src/hooks/use-group/use-group-edit/index.ts (3)
src/types/service/group.ts (2)
  • GroupIdParams (204-206)
  • CreateGroupPayload (91-105)
src/api/index.ts (1)
  • API (22-22)
src/lib/query-key/query-key-group/index.ts (1)
  • groupKeys (1-10)
src/hooks/use-group/use-group-leave/index.ts (2)
src/types/service/group.ts (1)
  • GroupIdParams (204-206)
src/lib/query-key/query-key-group/index.ts (1)
  • groupKeys (1-10)
src/hooks/use-group/use-group-attend/index.ts (3)
src/types/service/group.ts (1)
  • GroupIdParams (204-206)
src/api/index.ts (1)
  • API (22-22)
src/lib/query-key/query-key-group/index.ts (1)
  • groupKeys (1-10)
src/app/post-meetup/[groupId]/layout.tsx (2)
src/api/index.ts (1)
  • API (22-22)
src/lib/query-key/query-key-group/index.ts (1)
  • groupKeys (1-10)
🪛 Biome (2.1.2)
src/app/post-meetup/[groupId]/page.tsx

[error] 76-76: Avoid passing children using a prop

The canonical way to pass children in React is to use JSX elements

(lint/correctness/noChildrenProp)


[error] 77-77: Avoid passing children using a prop

The canonical way to pass children in React is to use JSX elements

(lint/correctness/noChildrenProp)


[error] 78-78: Avoid passing children using a prop

The canonical way to pass children in React is to use JSX elements

(lint/correctness/noChildrenProp)


[error] 80-80: Avoid passing children using a prop

The canonical way to pass children in React is to use JSX elements

(lint/correctness/noChildrenProp)


[error] 83-83: Avoid passing children using a prop

The canonical way to pass children in React is to use JSX elements

(lint/correctness/noChildrenProp)


[error] 85-85: Avoid passing children using a prop

The canonical way to pass children in React is to use JSX elements

(lint/correctness/noChildrenProp)


[error] 88-88: Avoid passing children using a prop

The canonical way to pass children in React is to use JSX elements

(lint/correctness/noChildrenProp)


[error] 92-92: Avoid passing children using a prop

The canonical way to pass children in React is to use JSX elements

(lint/correctness/noChildrenProp)

🔇 Additional comments (12)
src/app/post-meetup/page.tsx (2)

33-33: LGTM!

새로운 joinPolicy 필드가 올바르게 기본값으로 추가되었습니다.


44-44: LGTM!

폼 값을 직접 전달하도록 단순화되었습니다. 타입이 이미 일치하므로 스프레드 연산자가 필요하지 않습니다.

src/types/service/group.ts (2)

104-104: LGTM!

CreateGroupPayloadjoinPolicy 필드가 올바르게 추가되었습니다.


204-205: LGTM!

GroupIdPayloadGroupIdParams로 명확하게 이름을 변경했습니다.

src/lib/schema/group.ts (1)

28-28: LGTM!

joinPolicy 필드에 대한 검증이 올바르게 추가되었습니다. Zod 리터럴 유니온 사용이 적절합니다.

src/hooks/use-group/use-group-get-details/index.ts (1)

5-10: LGTM!

GroupIdPayload에서 GroupIdParams로의 리팩토링이 올바르게 적용되었습니다.

src/hooks/use-group/use-group-delete/index.ts (1)

4-8: LGTM!

GroupIdParams 리팩토링이 일관되게 적용되었습니다.

src/hooks/use-group/use-group-leave/index.ts (1)

5-13: LGTM!

GroupIdParams 리팩토링이 올바르게 적용되었습니다. 모든 참조가 일관되게 업데이트되었습니다.

src/app/post-meetup/[groupId]/page.tsx (1)

76-88: Biome 경고는 무시해도 됨 - @tanstack/react-form의 의도된 패턴

children prop 사용에 대한 Biome 경고는 @tanstack/react-form의 Field 컴포넌트가 render prop 패턴으로 설계되었기 때문에 발생하는 false positive입니다. 이 라이브러리에서는 이 방식이 공식 문서에서 권장하는 사용법입니다.

src/hooks/use-group/use-group-attend/index.ts (1)

5-13: LGTM!

GroupIdPayload에서 GroupIdParams로의 타입 변경과 파라미터 이름 변경이 일관되게 적용되었습니다. API 호출과 캐시 무효화 로직 모두 올바르게 업데이트되었습니다.

src/api/service/group-service/index.ts (2)

46-48: LGTM!

editGroup 메서드가 PATCH 메서드를 사용하여 올바르게 구현되었습니다. CreateGroupResponse를 반환 타입으로 사용하는 것은 수정 후 생성된 리소스 정보를 반환하는 일반적인 패턴입니다.


50-64: 리팩토링이 일관되게 적용됨

GroupIdPayload에서 GroupIdParams로의 네이밍 변경이 모든 메서드에 일관되게 적용되었습니다. 라우트 파라미터와 요청 페이로드를 명확히 구분하는 좋은 개선입니다.

Comment on lines +31 to +42
const { data } = useGetGroupDetails({ groupId });
const { mutateAsync: EditGroup } = useEditGroup({ groupId });

const {
title,
address: { location },
startTime,
tags,
description,
maxParticipants,
images,
} = data as GetGroupDetailsResponse;
Copy link
Contributor

@coderabbitai coderabbitai bot Dec 23, 2025

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

data가 undefined일 경우 런타임 에러 발생 가능

useGetGroupDetails가 로딩 중이거나 에러 상태일 때 dataundefined일 수 있습니다. 타입 단언(as GetGroupDetailsResponse)으로 이를 무시하면 구조 분해 할당 시 런타임 에러가 발생합니다.

레이아웃에서 prefetch와 권한 체크를 수행한다고 해도, 클라이언트 컴포넌트에서는 데이터 로딩 상태를 명시적으로 처리하는 것이 안전합니다.

🔎 제안된 수정 사항
  const { data } = useGetGroupDetails({ groupId });
- const { mutateAsync: EditGroup } = useEditGroup({ groupId });

- const {
-   title,
-   address: { location },
-   startTime,
-   tags,
-   description,
-   maxParticipants,
-   images,
- } = data as GetGroupDetailsResponse;
+ const { mutateAsync: EditGroup } = useEditGroup({ groupId });
+
+ if (!data) {
+   return null; // 또는 로딩 스피너
+ }
+
+ const {
+   title,
+   address: { location },
+   startTime,
+   tags,
+   description,
+   maxParticipants,
+   images,
+ } = data;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const { data } = useGetGroupDetails({ groupId });
const { mutateAsync: EditGroup } = useEditGroup({ groupId });
const {
title,
address: { location },
startTime,
tags,
description,
maxParticipants,
images,
} = data as GetGroupDetailsResponse;
const { data } = useGetGroupDetails({ groupId });
const { mutateAsync: EditGroup } = useEditGroup({ groupId });
if (!data) {
return null; // 또는 로딩 스피너
}
const {
title,
address: { location },
startTime,
tags,
description,
maxParticipants,
images,
} = data;
🤖 Prompt for AI Agents
In src/app/post-meetup/[groupId]/page.tsx around lines 31 to 42, you destructure
fields from data using a type assertion which will throw if data is undefined
during loading or error; guard against undefined by checking data before
destructuring (e.g., return a loading/error UI or early return when !data), or
provide safe defaults/optional chaining when extracting nested fields
(address?.location) and only call useEditGroup when groupId/data is present;
update the code to handle loading and error states explicitly instead of
assuming data exists.

Copy link
Member Author

Choose a reason for hiding this comment

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

근데 진지하게 수정 페이지에서 data가 undefined 이면 그냥 터지는게 맞는게 아닐까?

Copy link
Contributor

Choose a reason for hiding this comment

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

@HopeFullee, 좋은 지적이십니다. 타당한 관점입니다.

레이아웃에서 prefetch와 권한 검증을 통해 데이터가 보장된다면, dataundefined인 상황은 정상적인 로딩 상태가 아니라 시스템 오류를 의미합니다. 이 경우 "fail fast" 원칙에 따라 일찍 터져서 문제를 명확히 드러내는 것이 오히려 더 나은 선택일 수 있습니다.

이 접근의 장점:

  • 버그나 아키텍처 문제를 즉시 발견 가능
  • 불가능한 상태를 조용히 처리하면서 실제 문제를 숨기지 않음
  • 레이아웃의 보장이 깨졌을 때 명확한 신호

고려사항:

  • 하이드레이션 불일치나 네트워크 일시적 오류 같은 엣지 케이스에서도 크래시 발생
  • 사용자 경험 측면에서는 로딩 상태가 더 우아할 수 있음

하지만 아키텍처 설계 의도를 고려하면 현재 코드가 맞습니다. 제안을 무시하셔도 됩니다. 👍

Copy link
Member Author

Choose a reason for hiding this comment

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

그나저나 @claudia99503 님은 왜 자꾸 너를 부르는걸까?

Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!

Comment on lines +15 to +18
console.log('모임 생성 성공.');
},
onError: () => {
console.log('모임 생성 실패.');
Copy link
Contributor

@coderabbitai coderabbitai bot Dec 23, 2025

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

콘솔 메시지가 편집이 아닌 생성을 참조하고 있습니다.

성공 및 오류 콘솔 로그에 "모임 생성"이 표시되지만 이 훅은 모임을 편집하는 것입니다. 올바른 메시지로 수정해주세요.

🔎 제안된 수정
     onSuccess: async () => {
       await queryClient.invalidateQueries({ queryKey: groupKeys.detail(params.groupId) });
 
-      console.log('모임 생성 성공.');
+      console.log('모임 수정 성공.');
     },
     onError: () => {
-      console.log('모임 생성 실패.');
+      console.log('모임 수정 실패.');
     },
🤖 Prompt for AI Agents
In src/hooks/use-group/use-group-edit/index.ts around lines 15 to 18, the
success and error console logs currently say "모임 생성 성공." and "모임 생성 실패." even
though this hook performs group editing; change both messages to refer to
editing (e.g., "모임 수정 성공." and "모임 수정 실패."). Ensure you update the onSuccess and
onError console.log strings accordingly so logs correctly reflect the edit
operation.

Copy link
Member Author

Choose a reason for hiding this comment

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

올 ㅋ create hook 복사해와서 수정한건데 이걸 잡네

Copy link
Contributor

Choose a reason for hiding this comment

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

@HopeFullee 복사-붙여넣기할 때 이런 실수는 흔하죠! 😄 수정해주시면 감사하겠습니다!

    (\(\
    (=^.^=)
    (")_(")

코드 레빗이 처음으로 도움이된 건

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link
Member

@claudia99503 claudia99503 left a comment

Choose a reason for hiding this comment

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

이집 토끼 일 잘하네요 리뷰 얌얌

@HopeFullee HopeFullee merged commit 0d571dd into main Dec 23, 2025
10 checks passed
@HopeFullee HopeFullee deleted the somang-feat/edit-group branch December 23, 2025 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ready For Review! 리뷰 받을 준비가 되었습니다.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants