diff --git a/packages/web-domains/src/user/features/modify-user-info/components/ModifyIntroForm.tsx b/packages/web-domains/src/user/features/modify-user-info/components/ModifyIntroForm.tsx index bd70046e..41c5aeb2 100644 --- a/packages/web-domains/src/user/features/modify-user-info/components/ModifyIntroForm.tsx +++ b/packages/web-domains/src/user/features/modify-user-info/components/ModifyIntroForm.tsx @@ -1,5 +1,6 @@ import { Txt, Button } from '@sds/components'; import { colors } from '@sds/theme'; +import { useSearchParams } from 'next/navigation'; import { useForm } from 'react-hook-form'; import { buttonWrapperCss } from '../../get-user-info/components/Form/styles'; @@ -13,11 +14,13 @@ export interface IntroFormType { const MAX_LENGTH = 3000; export const ModifyIntroForm = () => { + const searchParams = useSearchParams(); + const { register, formState: { isValid }, handleSubmit, - } = useForm({ defaultValues: { introduction: '' } }); + } = useForm({ defaultValues: { introduction: searchParams.get('introduction') || '' } }); const { handleModifyUserInfo } = useModifyUserInfoService(); diff --git a/packages/web-domains/src/user/features/modify-user-info/containers/ModifyUserInfoContainer.tsx b/packages/web-domains/src/user/features/modify-user-info/containers/ModifyUserInfoContainer.tsx index 4b669ed4..b570c9a2 100644 --- a/packages/web-domains/src/user/features/modify-user-info/containers/ModifyUserInfoContainer.tsx +++ b/packages/web-domains/src/user/features/modify-user-info/containers/ModifyUserInfoContainer.tsx @@ -37,6 +37,9 @@ export const ModifyUserInfoContainer = () => { const hobbyIds = memberMe.hobbyDetails.map((hobby) => hobby.hobbyId).toString(); params.append('hobbyIds', hobbyIds); } + if (memberMe.introduction) { + params.append('introduction', memberMe.introduction); + } router.replace(`?${params.toString()}`); } }, [memberMe, step]);