Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

기업 대표번호 수정 #136

Merged
merged 2 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion apps/company/src/apis/company/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export interface IUpdateCompanyInfoRequest {
company_introduce: string;
email: string;
manager_name: string;
manager_phone_no: string;
company_profile_url?: string;
service_name: string;
business_area_code: number | string;
Expand Down
45 changes: 7 additions & 38 deletions apps/company/src/app/registration/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,6 @@ export default function Registration() {
company_introduce: myCompanyInfo?.company_introduce || "",
email: myCompanyInfo?.email || "",
manager_name: myCompanyInfo?.manager_name || "",
manager_phone_no: regex.phone_number(
myCompanyInfo?.manager_phone_no || ""
),
company_profile_url: myCompanyInfo?.company_logo_url,
headquarter: myCompanyInfo?.headquarter || false,
},
Expand Down Expand Up @@ -201,7 +198,6 @@ 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 @@ -212,7 +208,6 @@ 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 @@ -370,36 +365,6 @@ export default function Registration() {
errorMessage={errors.business_number?.message}
/>
</InputTemplate>,
<InputTemplate
key="representative-phone-no"
title="기업 대표 번호"
required
>
<Controller
control={control}
name="representative_phone_no"
rules={{
required: "필수 입력 항목입니다.",
pattern: {
value: /^\d{2,3}-\d{3,4}-\d{4}$/,
message: "유효한 전화번호 형식이 아닙니다.",
},
}}
render={({ field }) => (
<Input
{...field}
type="tel"
width={604}
placeholder="nnn-nnnn-nnnn"
maxLength={13}
onChange={e =>
field.onChange(regex.phone_number(e.target.value))
}
errorMessage={errors.representative_phone_no?.message}
/>
)}
/>
</InputTemplate>,
<InputTemplate key="representative-name" title="대표자" required>
<Input
width={604}
Expand Down Expand Up @@ -594,10 +559,14 @@ export default function Registration() {
errorMessage={errors.manager_name?.message}
/>
</InputTemplate>
<InputTemplate key="manager-phone-no" title="전화번호" required>
<InputTemplate
key="representative_phone_no"
title="대표 연락처"
required
>
<Controller
control={control}
name="manager_phone_no"
name="representative_phone_no"
rules={{
required: "필수 입력 항목입니다.",
pattern: {
Expand All @@ -615,7 +584,7 @@ export default function Registration() {
onChange={e =>
field.onChange(regex.phone_number(e.target.value))
}
errorMessage={errors.manager_phone_no?.message}
errorMessage={errors.representative_phone_no?.message}
/>
)}
/>
Expand Down