Skip to content

Commit

Permalink
fix: 모집공고 생성 쿼리 body 타입 수정 (WIP)
Browse files Browse the repository at this point in the history
  • Loading branch information
hyosin-Jang committed Apr 30, 2024
1 parent b5a1a6e commit 4daf130
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Hooks/recruitments/useCreateRecruitment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@ import { createRecruitment } from '@/Apis/recruitment';
import { RECRUITMENT } from '@/Constants/queryString';
import { RecruitmentForm } from '@/Types/study';

// TODO: 타입, 자식에서 확장하는 구조로 수정하기 > 보낼 때는 number[]로 보냄.

export interface RecruitmentFormRequest extends Omit<RecruitmentForm, 'stackIds'> {}
export const useCreateRecruitmentMutation = (studyId: number, successHandler?: () => void) => {
const navigate = useNavigate();

const { mutate } = useMutation({
mutationKey: [...RECRUITMENT.CREATE_RECRUITMENT(studyId)],
mutationFn: (body: RecruitmentForm) => createRecruitment(studyId, body),
mutationFn: (body: any) => createRecruitment(studyId, body),
onSuccess: () => {
navigate(`/studies/${studyId}`);
successHandler && successHandler();
Expand Down

0 comments on commit 4daf130

Please sign in to comment.