From f49091ca432e50da6aca8b7f000320f2a2682c42 Mon Sep 17 00:00:00 2001 From: Savien/Woo Jun Han <49388937+MrMirror21@users.noreply.github.com> Date: Sun, 27 Oct 2024 02:37:50 +0900 Subject: [PATCH] =?UTF-8?q?:sparkles:=20feat:=20=EC=84=9C=EB=A5=98=20?= =?UTF-8?q?=EC=9E=AC=EA=B2=80=ED=86=A0=20=EC=9A=94=EC=B2=AD=20=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80,=20=EB=A1=9C=EC=A7=81=20=EA=B5=AC=ED=98=84?= =?UTF-8?q?=20#54?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/document.ts | 14 +++++ src/hooks/api/useDocument.ts | 13 +++++ .../WriteDocuments/RequestModifyPage.tsx | 54 +++++++++++++++++++ src/router.tsx | 2 + 4 files changed, 83 insertions(+) create mode 100644 src/pages/WriteDocuments/RequestModifyPage.tsx 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 ( +