From 3567974cd679d1dcc8c1688efeea251ed37321b1 Mon Sep 17 00:00:00 2001 From: kikiyeom Date: Wed, 6 Mar 2024 18:45:36 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9E=84=EC=8B=9C=20=EC=BB=A4=EB=B0=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ScheduleTemplate.component.tsx | 21 ++++++++++++------- .../ScheduleTemplate.styled.ts | 8 ++++++- .../UpdateSchedule/UpdateSchedule.page.tsx | 1 + src/utils/schedule.ts | 7 +++++-- 4 files changed, 27 insertions(+), 10 deletions(-) diff --git a/src/components/Schedule/ScheduleTemplate/ScheduleTemplate.component.tsx b/src/components/Schedule/ScheduleTemplate/ScheduleTemplate.component.tsx index d021232f..aec49d44 100644 --- a/src/components/Schedule/ScheduleTemplate/ScheduleTemplate.component.tsx +++ b/src/components/Schedule/ScheduleTemplate/ScheduleTemplate.component.tsx @@ -125,16 +125,23 @@ const ScheduleTemplate = () => { /> {locationType === LocationType.OFFLINE && ( - + + + + + - - + )} diff --git a/src/components/Schedule/ScheduleTemplate/ScheduleTemplate.styled.ts b/src/components/Schedule/ScheduleTemplate/ScheduleTemplate.styled.ts index 4dd16bc6..93648f02 100644 --- a/src/components/Schedule/ScheduleTemplate/ScheduleTemplate.styled.ts +++ b/src/components/Schedule/ScheduleTemplate/ScheduleTemplate.styled.ts @@ -64,10 +64,16 @@ export const RequiredDot = styled.span` export const RadioButtonGroup = styled.div` display: flex; gap: 2rem; - margin-bottom: 1rem; + margin-bottom: 0.6rem; `; export const InputWithButton = styled.div` display: flex; gap: 1rem; `; + +export const LocationWrapper = styled.div` + display: flex; + flex-direction: column; + gap: 0.6rem; +`; diff --git a/src/pages/UpdateSchedule/UpdateSchedule.page.tsx b/src/pages/UpdateSchedule/UpdateSchedule.page.tsx index e36ebcca..cf8e64ef 100644 --- a/src/pages/UpdateSchedule/UpdateSchedule.page.tsx +++ b/src/pages/UpdateSchedule/UpdateSchedule.page.tsx @@ -44,6 +44,7 @@ const UpdateSchedule = () => { const handleSubmitForm: SubmitHandler = useRecoilCallback( ({ set }) => async (data) => { + console.log('updateScheduleRequest'); const updateScheduleRequest = parseFormValuesToScheduleRequest(data); if (!scheduleId) { diff --git a/src/utils/schedule.ts b/src/utils/schedule.ts index caaa7a89..7067e127 100644 --- a/src/utils/schedule.ts +++ b/src/utils/schedule.ts @@ -27,6 +27,7 @@ export interface ScheduleFormValues { longitude: string; placeName: string; }; + detailAddress?: string; } export const getScheduleStatusText = (status: ValueOf) => { @@ -73,8 +74,10 @@ export const parseScheduleResponseToFormValues = ( export const parseFormValuesToScheduleRequest = ( formValues: ScheduleFormValues, ): ScheduleCreateRequest | ScheduleUpdateRequest => { - const { generationNumber, date, sessions, name, locationType, locationInfo } = formValues; + const { generationNumber, date, sessions, name, locationType, locationInfo, detailAddress } = + formValues; + console.log(locationType, 'detailAddress', detailAddress, locationInfo); const formattedDate = date.format('YYYY-MM-DD'); const eventsCreateRequests: EventCreateRequest[] = sessions.map((session) => ({ @@ -99,7 +102,7 @@ export const parseFormValuesToScheduleRequest = ( }; if (locationType === LocationType.OFFLINE && locationInfo) { - scheduleRequest.address = locationInfo.address; + scheduleRequest.address = `${locationInfo.address}${detailAddress ? `(${detailAddress})` : ''}`; scheduleRequest.latitude = Number(locationInfo.latitude); scheduleRequest.longitude = Number(locationInfo.longitude); scheduleRequest.placeName = locationInfo.placeName;