Skip to content

Commit

Permalink
fix :: replace 오류 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
은지 committed Nov 6, 2024
1 parent 38d3d5c commit ee76b23
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/Components/Detail/CompanyDetail/Basic/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export function CompanyDetailBasic({
</_.ContentBox>
<_.TitleBox>대표 전화번호</_.TitleBox>
<_.ContentBox width={15}>
{companyDetailInfo?.representative_phone_no.replace(
{(companyDetailInfo?.representative_phone_no || '').replace(
/(\d{3})(\d{4})(\d{4})/,
'$1-$2-$3'
)}
Expand Down
20 changes: 6 additions & 14 deletions src/Components/Detail/CompanyDetail/Edit/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -405,21 +405,13 @@ export function CompanyDetailEdit({
placeholder="팩스번호"
width={100}
type="text"
value={
fax?.replace(/(\d{3})(\d{4})(\d{4})/, '$1-$2-$3') ||
fax ||
''
}
value={fax ? fax : ''}
name="fax"
onChange={(e) => {
const onlyNumbers = e.target.value.replace(
/[^0-9]/g,
''
);
setCompanyDetailEditInfo((prev) => ({
...prev,
fax: onlyNumbers,
}));
onChange={(event) => {
const value = event.target.value;
if (/^\d*$/.test(value)) {
companyDetailEditInfohandler(event);
}
}}
/>
</_.ContentBox>
Expand Down

0 comments on commit ee76b23

Please sign in to comment.