Skip to content

Commit

Permalink
fix :: 전화번호 하이픈 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
eejx0 committed Nov 7, 2024
1 parent a5240fd commit 42fb18c
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion apps/company/src/app/registration/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ export default function Registration() {
manager_name: myCompanyInfo?.manager_name || "",
company_profile_url: myCompanyInfo?.company_logo_url,
headquarter: myCompanyInfo?.headquarter || false,
manager_phone_no: myCompanyInfo?.manager_phone_no || "",
manager_phone_no: regex.phone_number(
myCompanyInfo?.manager_phone_no || ""
),
},
});
const { toast } = useToast();
Expand Down Expand Up @@ -191,6 +193,7 @@ export default function Registration() {
const onSubmit: SubmitHandler<ICompanyRegisterRequest> = data => {
const {
representative_phone_no,
manager_phone_no,
sub_address_detail,
sub_zip_code,
take,
Expand All @@ -201,6 +204,7 @@ export default function Registration() {

const requests = {
representative_phone_no: representative_phone_no.replaceAll("-", ""),
manager_phone_no: manager_phone_no.replaceAll("-", ""),
sub_zip_code: sub_zip_code || undefined,
sub_address_detail: sub_address_detail || undefined,
take: +take.toString().replaceAll(",", ""),
Expand Down Expand Up @@ -582,6 +586,32 @@ export default function Registration() {
errorMessage={errors.manager_name?.message}
/>
</InputTemplate>
{/* <InputTemplate key="manager_phone_no" title="전화번호" required>
<Controller
control={control}
name="manager_phone_no"
rules={{
required: "필수 입력 항목입니다.",
pattern: {
value: /^\d{2,3}-\d{3,4}-\d{4}$/,
message: "유효한 전화번호 형식이 아닙니다.",
},
}}
render={({ field }) => (
<Input
{...field}
type="tel"
width={223}
placeholder="nnn-nnnn-nnnn"
maxLength={13}
onChange={e =>
field.onChange(regex.phone_number(e.target.value))
}
errorMessage={errors.manager_phone_no?.message}
/>
)}
/>
</InputTemplate> */}
<InputTemplate key="manager_phone_no" title="전화번호" required>
<Controller
control={control}
Expand All @@ -608,6 +638,7 @@ export default function Registration() {
)}
/>
</InputTemplate>
,
</Flex>,
<InputTemplate key="email" title="이메일" required>
<Controller
Expand Down

0 comments on commit 42fb18c

Please sign in to comment.