diff --git a/src/api/document.ts b/src/api/document.ts index a8dae3cd..3f06559e 100644 --- a/src/api/document.ts +++ b/src/api/document.ts @@ -105,3 +105,17 @@ export const searchSchool = async ( ); return response.data; }; + +// 8.9 (유학생) 서류 (근로계약서, 시간제 취업허가서) 재검토 요청하기 +export const postRequest = async ({ + id, + reason, +}: { + id: number; + reason: string; +}): Promise<{ id: number }> => { + const response = await api.post(`/users/documents/${id}/status/requestion`, { + reason: reason, + }); + return response.data; +}; diff --git a/src/hooks/api/useDocument.ts b/src/hooks/api/useDocument.ts index 9dea24f5..605c14f9 100644 --- a/src/hooks/api/useDocument.ts +++ b/src/hooks/api/useDocument.ts @@ -1,6 +1,7 @@ import { postIntegratedApplications, postPartTimeEmployPermit, + postRequest, postStandardLaborContracts, putIntegratedApplications, putPartTimeEmployPermit, @@ -131,3 +132,15 @@ export const useSearchSchool = ({ }); return { searchSchool: mutate, ...rest }; }; + +// 8.14 (유학생) 통합신청서 수정 api 통신 커스텀 훅 +export const usePostRequest = () => { + const navigate = useNavigate(); + return useMutation({ + mutationFn: postRequest, + onSuccess: () => { + navigate('/application-documents'); + }, + onError: () => navigate('/request-modify'), + }); +}; diff --git a/src/pages/WriteDocuments/RequestModifyPage.tsx b/src/pages/WriteDocuments/RequestModifyPage.tsx new file mode 100644 index 00000000..140cbfb8 --- /dev/null +++ b/src/pages/WriteDocuments/RequestModifyPage.tsx @@ -0,0 +1,54 @@ +import BottomButtonPanel from '@/components/Common/BottomButtonPanel'; +import Button from '@/components/Common/Button'; +import BaseHeader from '@/components/Common/Header/BaseHeader'; +import { usePostRequest } from '@/hooks/api/useDocument'; +import { useState } from 'react'; +import { useNavigate } from 'react-router-dom'; + +const RequestModifyPage = () => { + const navigate = useNavigate(); + const [reasonInput, setReasonInput] = useState(''); + const { mutate: sendRequest } = usePostRequest(); + return ( +
+ navigate('/application-documents')} + /> +
+
+ Reason for Request +
+
+
+
+