diff --git a/src/features/study/group/ui/group-study-form-modal.tsx b/src/features/study/group/ui/group-study-form-modal.tsx index ff19a2dd..3f922ed7 100644 --- a/src/features/study/group/ui/group-study-form-modal.tsx +++ b/src/features/study/group/ui/group-study-form-modal.tsx @@ -87,11 +87,23 @@ export default function GroupStudyFormModal({ const refineStudyDetail = (value: GroupStudyFullResponseDto) => { if (isLoading) return; + const refinedClassification = + value.basicInfo?.classification ?? classification; + const originalType = value.basicInfo?.type; + + let refinedType = originalType; + if ( + refinedClassification === 'GROUP_STUDY' && + originalType === 'MENTORING' + ) { + refinedType = undefined; + } + return { - classification: value.basicInfo?.classification ?? classification, + classification: refinedClassification, studyLeaderParticipation: value.basicInfo.studyLeaderParticipation ?? false, - type: value.basicInfo?.type, + type: refinedType, targetRoles: value.basicInfo?.targetRoles, maxMembersCount: value.basicInfo?.maxMembersCount?.toString() ?? '', experienceLevels: value.basicInfo?.experienceLevels, diff --git a/src/features/study/group/ui/step/step1-group.tsx b/src/features/study/group/ui/step/step1-group.tsx index 86e7006b..f25a7f25 100644 --- a/src/features/study/group/ui/step/step1-group.tsx +++ b/src/features/study/group/ui/step/step1-group.tsx @@ -1,13 +1,14 @@ 'use client'; import { addDays } from 'date-fns'; +import { useEffect } from 'react'; import { Controller, useController, useFormContext, useWatch, } from 'react-hook-form'; -import Checkbox from '@/components/ui/checkbox'; + import { SingleDropdown } from '@/components/ui/dropdown'; import FormField from '@/components/ui/form/form-field'; import { BaseInput } from '@/components/ui/input'; @@ -52,44 +53,20 @@ export default function Step1OpenGroupStudy() { name: 'regularMeeting', control, }); - const { field: studyLeaderParticipationField } = useController({ - name: 'studyLeaderParticipation', - control, - }); + const methodValue = useWatch({ name: 'method', control, }); + const filteredStudyTypes = + classification === 'GROUP_STUDY' + ? STUDY_TYPES.filter((type) => type !== 'MENTORING') + : STUDY_TYPES; + return ( <>
기본 정보 설정
- - name="studyLeaderParticipation" - label="리더 참여 여부" - helper="스터디 리더가 직접 스터디에 참여하는지 선택해주세요." - direction="vertical" - size="medium" - required - > -
- - studyLeaderParticipationField.onChange( - !studyLeaderParticipationField.value, - ) - } - /> - -
- name="type" label="스터디 유형" @@ -103,14 +80,14 @@ export default function Step1OpenGroupStudy() { value={typeField.value} onValueChange={typeField.onChange} > - {STUDY_TYPES.map((type) => ( + {filteredStudyTypes.map((type) => (
))}