Skip to content

Commit

Permalink
feat :: 모집의뢰서 수정시 본사와 동일합니다 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
dnjsdmswl authored Nov 6, 2024
2 parents fcf0e3b + 24e3449 commit 0e8af1b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Apis/Companies/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ export interface CompanyInfoEditType {
service_name: string;
company_profile_url: string;
representative_phone_no: string;
headquarter: boolean;
}
24 changes: 24 additions & 0 deletions src/Components/Detail/CompanyDetail/Edit/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ export function CompanyDetailEdit({
setCanEdit,
refetchCompanyDetailInfo,
}: PropsType) {
const [headquarter, setHeadquarter] = useState(
companyDetailInfo?.headquarter
);
const navigate = useNavigate();
const { append } = useToastStore();
const fileInput = useRef<HTMLInputElement>(null);
Expand Down Expand Up @@ -61,6 +64,7 @@ export function CompanyDetailEdit({
service_name: companyDetailInfo?.service_name,
company_profile_url: companyDetailInfo?.company_profile_url,
representative_phone_no: companyDetailInfo?.representative_phone_no,
headquarter: companyDetailInfo?.headquarter,
});

const {
Expand Down Expand Up @@ -131,7 +135,19 @@ export function CompanyDetailEdit({
}
};

const handleHeadquarterChange = () => {
setHeadquarter((prev) => !prev);
setCompanyDetailEditInfo((prev) => ({
...prev,
headquarter: !headquarter,
}));
};

const submitEditCompanyInfo = () => {
setCompanyDetailEditInfo((prev) => ({
...prev,
headquarter,
}));
if (selectedFile) {
handleFileUploadAndEdit();
} else {
Expand Down Expand Up @@ -272,6 +288,14 @@ export function CompanyDetailEdit({
name="main_address"
onChange={companyDetailEditInfohandler}
/>
<_.CheckEmailWrapper>
<_.CheckBox
type="checkbox"
checked={headquarter}
onChange={handleHeadquarterChange}
/>
<_.CheckLogin>본사와 동일 합니다.</_.CheckLogin>
</_.CheckEmailWrapper>
</_.ContentBox>
</_.Stack>
<_.Stack>
Expand Down

0 comments on commit 0e8af1b

Please sign in to comment.