Skip to content

Commit

Permalink
Merge branch 'develop' into feature/38-banner_page
Browse files Browse the repository at this point in the history
  • Loading branch information
dnjsdmswl authored Mar 7, 2024
2 parents 70b396b + 95eeacd commit 50a1d85
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"zustand": "^4.4.7"
},
"scripts": {
"start": "set PORT=4000 && react-scripts start",
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
Expand Down
6 changes: 3 additions & 3 deletions src/Apis/Applications/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const useGetApplicantInfo = (
return useQuery({
queryKey: ['getApplicantInfo', applicationQueryString],
queryFn: async () => {
const { page, application_status, student_name, recruitment_id } =
const { page, application_status, student_name, recruitment_id, year } =
applicationQueryString;
const pageNum = page ? `&page=${page}` : '';
const studentName = student_name
Expand All @@ -27,12 +27,12 @@ export const useGetApplicantInfo = (
: '';
const queryString =
application_status || student_name || recruitment_id || page
? `?application_status=${
? `&application_status=${
application_status ? application_status : ''
}${companyId}${studentName}${pageNum}`
: '';
const { data } = await instance.get<ApplicationResponse>(
`${router}${queryString}`
`${router}?year=${year}${queryString}`
);
return data;
},
Expand Down
1 change: 1 addition & 0 deletions src/Apis/Applications/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export interface ApplicantInfoQueryStringType {
application_status: string | StatusType;
student_name: string;
recruitment_id: string;
year: string;
}

export interface TrainDate {
Expand Down
16 changes: 16 additions & 0 deletions src/Components/ApplicationView/Search/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ interface PropsType {
export function ApplicationViewSearch({
refetchCompanyRecruitment,
}: PropsType) {
const date = new Date();
const {
applicationViewQueryString,
setDefaultApplicationViewQueryString,
Expand All @@ -24,6 +25,10 @@ export function ApplicationViewSearch({
setTimeout(refetchCompanyRecruitment);
};

const yearArray = Array.from({ length: 10 }, (_, idx) =>
(date.getFullYear() - idx).toString()
);

return (
<_.Container>
<_.Wrapper>
Expand Down Expand Up @@ -63,6 +68,17 @@ export function ApplicationViewSearch({
iconName="Search"
/>
</_.ContentWrapper>
<_.TitleText>년도</_.TitleText>
<_.ContentWrapper width={8.5}>
<DropDown
onChange={(year) =>
applicationViewQueryStringDropDown('year', year)
}
value={applicationViewQueryString.year}
width={95}
option={yearArray}
/>
</_.ContentWrapper>
<_.Btn>
<Button onClick={search}>조회</Button>
<Button
Expand Down
2 changes: 2 additions & 0 deletions src/Pages/PopUp/ApplicationPopup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ import { AttachmentUrlType } from '../../../Apis/Applications/response';
import { useGetApplicantInfo } from '../../../Apis/Applications';

export function ApplicationPopup() {
const date = new Date();
const id = new URLSearchParams(window.location.search).get('id');
const [applicationQueryString] = useState<ApplicantInfoQueryStringType>({
application_status: 'APPROVED',
student_name: '',
recruitment_id: id ? id : '',
year: date.getFullYear().toString(),
});

const {
Expand Down
2 changes: 2 additions & 0 deletions src/Pages/PopUp/RecruitmentRequestPopup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ import { AttachmentUrlType } from '../../../Apis/Applications/response';
import { useGetApplicantInfo } from '../../../Apis/Applications';

export function RecruitmentRequestPopup() {
const date = new Date();
const id = new URLSearchParams(window.location.search).get('id');
const [applicationQueryString] = useState<ApplicantInfoQueryStringType>({
application_status: 'REQUESTED',
student_name: '',
recruitment_id: id ? id : '',
year: date.getFullYear().toString(),
});

const {
Expand Down
2 changes: 2 additions & 0 deletions src/Store/State.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export const useApplicationViewQueryString =
application_status: '',
student_name: '',
recruitment_id: '',
year: date.getFullYear().toString(),
},
applicationViewQueryStringHandler: (e) =>
set((prev) => ({
Expand All @@ -54,6 +55,7 @@ export const useApplicationViewQueryString =
application_status: '',
student_name: '',
recruitment_id: '',
year: date.getFullYear().toString(),
},
}),
setApplicationViewQueryString: (queryString) =>
Expand Down

0 comments on commit 50a1d85

Please sign in to comment.