Skip to content

Commit adf165c

Browse files
committed
feat(recruit): 모집 알림 신청 시 API 호출 추가 (#17)
1 parent f8aa471 commit adf165c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

apps/recruit/src/components/layout/NotifyInput.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,20 @@
33
import {Button} from '@repo/ui/components/buttons/Button';
44
import {useState} from 'react';
55
import {RecruitmentNotificationModal} from '@/components/modal/RecruitmentNotificationModal';
6+
import {useSubscribeRecruitmentNotify} from '@/hooks/mutations/useRecruitment.mutation';
67

78
export const NotifyInput = () => {
89
const [email, setEmail] = useState('');
910
const [isModalOpen, setIsModalOpen] = useState(false);
11+
const {mutate} = useSubscribeRecruitmentNotify();
1012

1113
const isValidEmail =
1214
email.length > 0 && /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email);
1315

1416
const handleSubmit = (e: React.FormEvent) => {
1517
e.preventDefault();
1618
if (isValidEmail) {
17-
// TODO: API 호출
19+
mutate({email});
1820
setIsModalOpen(true);
1921
}
2022
};

0 commit comments

Comments
 (0)