Skip to content

Commit

Permalink
feat: 전송 상태 추가 및 page 안 넘어가는 오류 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
JJIIIINN committed Dec 4, 2023
1 parent a276842 commit 2b6387b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 25 deletions.
21 changes: 10 additions & 11 deletions src/Apis/Recruitments/response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,17 @@ export interface RecruitmentFormResponse {
}

export interface RecruitmentFormType {
id: string;
company_id: string;
recruitment_status: string;
application_approved_count: number;
application_requested_count: number;
company_id: number;
company_name: string;
company_type: string;
recruitment_job: string;
recruitment_count: number;
application_requested_count: number;
application_approved_count: number;
start: string;
end: string;
military_support: boolean;
end_date: string;
hiring_jobs: string;
id: number;
start_date: string;
status: string;
total_hiring_count: number;
}

export interface RecruitmentFormDetailResponse {
Expand Down Expand Up @@ -43,5 +42,5 @@ export interface AreasType {
tech: string[];
hiring: number;
major_task: string;
preferential_treatment: string | null;
preferential_treatment: string | null;
}
27 changes: 13 additions & 14 deletions src/Components/RecruitmentForm/Table/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ export function RecruitmentFormTable({
}: PropsType) {
const { append } = useToastStore();

const { recruitmentFormQueryString, setRecruitmentFormQueryString } = useRecruitmentFormQueryString();
const { recruitmentFormQueryString, setRecruitmentFormQueryString } =
useRecruitmentFormQueryString();

/** 지원서 length입니다. */
const dataLength = recruitmentForm?.recruitments.length;
Expand Down Expand Up @@ -114,16 +115,17 @@ export function RecruitmentFormTable({
/** 데이터 테이블입니다. */
const tableAllDatas: JSX.Element[][] = recruitmentForm?.recruitments
.map((recruitment) => {
const job = recruitment.recruitment_job.split(',').join(' / ');
const job = recruitment.hiring_jobs.split(',').join(' / ');
const clickCheckBox = () => {
if (clickedData.includes(recruitment.id)) {
if (clickedData.includes(recruitment.id.toString())) {
setClickedData(
clickedData.filter(
(clickedDataId) => clickedDataId !== recruitment.id
(clickedDataId) =>
clickedDataId !== recruitment.id.toString()
)
);
} else {
setClickedData([...clickedData, recruitment.id]);
setClickedData([...clickedData, recruitment.id.toString()]);
}
};

Expand All @@ -145,14 +147,11 @@ export function RecruitmentFormTable({
};
return [
<CheckBox
checked={clickedData.includes(recruitment.id)}
checked={clickedData.includes(recruitment.id.toString())}
onChange={clickCheckBox}
/>,
<_.ContentText status={recruitment.recruitment_status}>
{getValueByKey(
companyStatus,
recruitment.recruitment_status
)}
<_.ContentText status={recruitment.status}>
{getValueByKey(companyStatus, recruitment.status)}
</_.ContentText>, // 상태
<Link to={`/Company/${recruitment.company_id}`}>
<_.ContentText click={1}>
Expand All @@ -166,7 +165,7 @@ export function RecruitmentFormTable({
{companyType[recruitment.company_type]}
</_.ContentText>, // 구분
<_.ContentText>
{recruitment.recruitment_count}
{recruitment.total_hiring_count}
</_.ContentText>, // 모집 인원 수
<_.ContentText
onClick={() =>
Expand All @@ -186,8 +185,8 @@ export function RecruitmentFormTable({
>
{recruitment.application_approved_count}
</_.ContentText>, // 지원자 수
<_.ContentText>{recruitment.start}</_.ContentText>, // 모집 시작 날짜
<_.ContentText>{recruitment.end}</_.ContentText>, // 모집 종료 날짜
<_.ContentText>{recruitment.start_date}</_.ContentText>, // 모집 시작 날짜
<_.ContentText>{recruitment.end_date}</_.ContentText>, // 모집 종료 날짜
];
})
.concat(emptyTableDataArray);
Expand Down

0 comments on commit 2b6387b

Please sign in to comment.