Skip to content

Commit f8aa471

Browse files
committed
feat(recruit): 모집 알림 구독 api 및 mutation 추가 (#17)
1 parent 7168ac3 commit f8aa471

2 files changed

Lines changed: 23 additions & 0 deletions

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import {postRecruitmentNotify} from '@/services/api/recruitment/recruitment.api';
2+
import {useMutation} from '@tanstack/react-query';
3+
4+
export const useSubscribeRecruitmentNotify = () => {
5+
return useMutation({
6+
mutationFn: postRecruitmentNotify,
7+
});
8+
};
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import {RecruitmentNotifyRequest} from '@/schemas/recruitment/recruitment.schema';
2+
import {publicAxios} from '@/services/config/axios';
3+
import {ENDPOINT} from '@/services/constant/endpoint';
4+
import {handleApiError} from '@/services/utils/apiHelper';
5+
6+
/** 모집 알림 구독 신청 */
7+
export const postRecruitmentNotify = async (
8+
data: RecruitmentNotifyRequest
9+
): Promise<void> => {
10+
try {
11+
await publicAxios.post(ENDPOINT.RECRUITMENT.SUBSCRIBE, data);
12+
} catch (error) {
13+
return handleApiError(error);
14+
}
15+
};

0 commit comments

Comments
 (0)