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

πŸ› fix: μ•„λ₯΄λ°”μ΄νŠΈ 지원 step3 μ™„λ£Œ ~ step7 였λ₯˜ ν•΄κ²° #130

Merged
merged 5 commits into from
Nov 25, 2024
8 changes: 8 additions & 0 deletions src/api/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ export const patchInterviewFinish = async (id: number) => {
return response.data;
};

// 6.12 (μœ ν•™μƒ) μ„œλ₯˜ μž‘μ„± μ™„λ£Œν•˜κΈ°
export const patchWritingDocumentFinish = async (id: number) => {
const response = await api.patch(
`/users/user-owner-job-postings/${id}/step-filling-out-documents`,
);
return response.data;
};

// 6.13 (μœ ν•™μƒ) μœ ν•™μƒ λ‹΄λ‹Ήμž κ²€ν†  μ™„λ£Œ
export const patchContactCoordinator = async (id: number) => {
const response = await api.patch(
Expand Down
6 changes: 4 additions & 2 deletions src/components/ApplicationDetail/ApplicationDetailStep7.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { buttonTypeKeys } from '@/constants/components';
import Button from '@/components/Common/Button';
import { useNavigate } from 'react-router-dom';
import { useNavigate, useParams } from 'react-router-dom';
import { ApplicationStepType } from '@/types/application/applicationItem';
import { APPLICATION_STEP } from '@/constants/application';

Expand All @@ -10,6 +10,8 @@ type ApplicationDetailStep7Props = {

const ApplicationDetailStep7 = ({ result }: ApplicationDetailStep7Props) => {
const navigate = useNavigate();
const { id } = useParams();


return (
<section className="flex flex-col items-center gap-[0.75rem] w-full px-[1.5rem] pt-[0.75rem] pb-[3.125rem]">
Expand All @@ -27,7 +29,7 @@ const ApplicationDetailStep7 = ({ result }: ApplicationDetailStep7Props) => {
fontColor="text-[#F4F4F9]"
isBorder={false}
title="Check the application documents"
onClick={() => navigate('/application-documents')}
onClick={() => navigate(`/application-documents/${id}`)}
/>
</section>
);
Expand Down
15 changes: 15 additions & 0 deletions src/hooks/api/useApplication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
patchContactCoordinator,
patchApplyHiKorea,
patchHiKoreaResult,
patchWritingDocumentFinish,
} from '@/api/application';
import { useMutation, useQuery } from '@tanstack/react-query';
import { useNavigate } from 'react-router-dom';
Expand Down Expand Up @@ -99,6 +100,20 @@ export const usePatchInterviewFinish = () => {
});
};

// 6.12 (μœ ν•™μƒ) μ„œλ₯˜ μž‘μ„± μ™„λ£Œν•˜κΈ° ν›…
export const usePatchWritingDocumentFinish = (id: number) => {
const navigate = useNavigate();
return useMutation({
mutationFn: patchWritingDocumentFinish,
onSuccess: () => {
navigate(`/application/${id}`);
},
onError: (error) => {
console.error('μ„œλ₯˜ μž‘μ„± μ™„λ£Œν•˜κΈ° μ‹€νŒ¨', error);
},
});
};

// 6.13 (μœ ν•™μƒ) μœ ν•™μƒ λ‹΄λ‹Ήμž κ²€ν†  μ™„λ£Œ ν›…
export const usePatchContactCoordinator = () => {
return useMutation({
Expand Down
32 changes: 25 additions & 7 deletions src/pages/ApplicationDocuments/ApplicationDocumentsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import BottomButtonPanel from '@/components/Common/BottomButtonPanel';
import Button from '@/components/Common/Button';
import BaseHeader from '@/components/Common/Header/BaseHeader';
import DocumentCardList from '@/components/Document/DocumentCardList';
import { usePatchWritingDocumentFinish } from '@/hooks/api/useApplication';
import { useGetDocumentsEmployee } from '@/hooks/api/useDocument';
import { useCurrentPostIdEmployeeStore } from '@/store/url';
import { DocumentsSummaryResponse } from '@/types/api/document';
Expand All @@ -11,6 +12,9 @@ const ApplicationDocumentsPage = () => {
const navigate = useNavigate();
const { currentPostId } = useCurrentPostIdEmployeeStore();
const { data, isPending } = useGetDocumentsEmployee(Number(currentPostId));
const { mutate: submitDocuments } = usePatchWritingDocumentFinish(
Number(currentPostId),
);
return (
<div>
<BaseHeader
Expand All @@ -25,13 +29,27 @@ const ApplicationDocumentsPage = () => {
documents={data?.data as DocumentsSummaryResponse}
/>
<BottomButtonPanel>
<Button
type="large"
bgColor="bg-[#F4F4F9]"
fontColor="text-[#bdbdbd]"
isBorder={false}
title="Next"
/>
{data?.data.part_time_employment_permits?.status ===
'CONFIRMATION' &&
data?.data.standard_labor_contract?.status === 'CONFIRMATION' &&
data?.data.integrated_application?.hwp_url ? (
<Button
type="large"
bgColor={'bg-[#FEF387]'}
fontColor="text-[#1E1926]"
title="Next"
isBorder={false}
onClick={() => submitDocuments(Number(currentPostId))}
/>
) : (
<Button
type="large"
bgColor="bg-[#F4F4F9]"
fontColor="text-[#bdbdbd]"
isBorder={false}
title="Next"
/>
)}
</BottomButtonPanel>
</>
)}
Expand Down
4 changes: 2 additions & 2 deletions src/pages/ApplicationResult/ApplicationResultPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ const ApplicationResultPage = () => {
Contract Feedback
</h3>
<textarea
className="px-[1rem] py-[0.75rem] border border-[#E2E5EB] rounded-[0.75rem] body-2"
className="px-[1rem] py-[0.75rem] border border-[#E2E5EB] rounded-[0.75rem] body-2 focus:outline-none"
placeholder="Write a contract review"
maxLength={200}
value={feedback}
onChange={(e) => setFeedback(e.target.value)}
/>
</section>
<footer className="fixed bottom-0 left-0 pt-[0.75rem] px-[1.5rem] pb-[3.125rem] bg-white">
<footer className="fixed w-full bottom-0 left-0 pt-[0.75rem] px-[1.5rem] pb-[3.125rem] bg-white">
<Button
type={buttonTypeKeys.LARGE}
bgColor={'bg-[#FEF387]'}
Expand Down