Skip to content

Commit

Permalink
✨ feat: 시간제취업허가서 작성 api 커스텀 훅화 #31
Browse files Browse the repository at this point in the history
  • Loading branch information
MrMirror21 committed Oct 24, 2024
1 parent a5f3573 commit 9a31945
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/hooks/api/useDocument.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { postPartTimeEmployPermit } from '@/api/document';
import { DocumentType } from '@/types/api/document';
import { useMutation } from '@tanstack/react-query';
import { useNavigate } from 'react-router-dom';

export const usePostPartTimeEmployPermit = () => {
const navigate = useNavigate();
return useMutation({
mutationFn: postPartTimeEmployPermit,
onSuccess: () => {
navigate('/');
},
onError: () =>
navigate('/write-documents', {
state: {
type: DocumentType.PART_TIME_PERMIT,
},
}),
});
};

0 comments on commit 9a31945

Please sign in to comment.