diff --git a/frontend/src/app/(client)/(auth)/find-password/components/FindForm/index.tsx b/frontend/src/app/(client)/(auth)/find-password/components/FindForm/index.tsx index c3cfcd11..c909dfb0 100644 --- a/frontend/src/app/(client)/(auth)/find-password/components/FindForm/index.tsx +++ b/frontend/src/app/(client)/(auth)/find-password/components/FindForm/index.tsx @@ -1,18 +1,12 @@ 'use client'; import { Form, Formik } from 'formik'; -import * as Yup from 'yup'; import EmailTextInput from '@/components/Formik/EmailTextInput'; import TextInput from '@/components/Formik/TextInput'; - -const validationSchema = Yup.object().shape({ - email: Yup.string() - .required('필수 입력란입니다. 이메일을 입력해주세요.') - .matches(/^((?!@).)*$/, '부산대 이메일만 가입 가능합니다. 이메일 도메인 부분을 삭제해주세요.') - .matches(/^[0-9a-zA-Z]([-_.]?[0-9a-zA-Z])*$/, '존재하는 이메일인지 확인해주세요.'), - name: Yup.string().required('필수 입력란입니다. 이름을 입력해주세요.'), -}); +import { useResetPasswordMutation } from '@/lib/hooks/useApi'; +import { toast } from 'react-toastify'; +import { useRouter } from 'next/navigation'; interface FormType { email: string; @@ -25,15 +19,29 @@ const initialValues: FormType = { }; const FindForm = () => { + const { mutate: resetPasswordMutation } = useResetPasswordMutation(); + const router = useRouter(); + const handleSubmitButtonClick = (values: FormType) => { - // TODO: 메일 발송 api 호출 - console.log(JSON.stringify(values)); + resetPasswordMutation( + { email: values.email, name: values.name }, + { + onSuccess(data, variables, context) { + toast.info('임시비밀번호 메일이 발송되었습니다.'); + setTimeout(function () { + router.push('/sign-in'); + }, 2000); + }, + onError(error, variables, context) { + toast.error(error.message); + }, + }, + ); }; return ( { setSubmitting(false); handleSubmitButtonClick(values); diff --git a/frontend/src/app/(client)/(withSidebar)/my-page/edit/page.tsx b/frontend/src/app/(client)/(withSidebar)/my-page/edit/page.tsx new file mode 100644 index 00000000..429d9ef8 --- /dev/null +++ b/frontend/src/app/(client)/(withSidebar)/my-page/edit/page.tsx @@ -0,0 +1,13 @@ +import Title from '@/components/Title'; + +const Page = () => { + return ( +
+ + + <div className="flex h-40 w-full items-center justify-center text-comment">개발 중인 기능입니다.</div> + </div> + ); +}; + +export default Page; diff --git a/frontend/src/app/admin/contest/create/page.tsx b/frontend/src/app/admin/contest/create/page.tsx new file mode 100644 index 00000000..bf4f4cdf --- /dev/null +++ b/frontend/src/app/admin/contest/create/page.tsx @@ -0,0 +1,9 @@ +const Page = () => { + return ( + <div className="w-full"> + <div className="flex h-40 w-full items-center justify-center text-comment">개발 중인 기능입니다.</div> + </div> + ); +}; + +export default Page; diff --git a/frontend/src/app/admin/contest/list/page.tsx b/frontend/src/app/admin/contest/list/page.tsx new file mode 100644 index 00000000..bf4f4cdf --- /dev/null +++ b/frontend/src/app/admin/contest/list/page.tsx @@ -0,0 +1,9 @@ +const Page = () => { + return ( + <div className="w-full"> + <div className="flex h-40 w-full items-center justify-center text-comment">개발 중인 기능입니다.</div> + </div> + ); +}; + +export default Page; diff --git a/frontend/src/app/admin/faculty/list/page.tsx b/frontend/src/app/admin/faculty/list/page.tsx index 42b6bcb6..59bb374a 100644 --- a/frontend/src/app/admin/faculty/list/page.tsx +++ b/frontend/src/app/admin/faculty/list/page.tsx @@ -21,7 +21,8 @@ const Page = ({ searchParams }: { searchParams?: { [key: string]: string | undef return ( <div className="w-full"> - <div className="flex items-center rounded-sm border-[1px] border-admin-border bg-admin-background-light px-5 py-3 text-sm"> + <div className="flex h-40 w-full items-center justify-center text-comment">개발 중인 기능입니다.</div> + {/* <div className="flex items-center rounded-sm border-[1px] border-admin-border bg-admin-background-light px-5 py-3 text-sm"> <span className="mr-20"> 총 <span className="text-admin-primary-main">{members.length}</span>명의 회원이 있습니다. </span> @@ -33,7 +34,7 @@ const Page = ({ searchParams }: { searchParams?: { [key: string]: string | undef totalItems={members.length} pathname={pathname} query={JSON.stringify(searchParams)} - /> + /> */} </div> ); }; diff --git a/frontend/src/app/admin/faculty/register/page.tsx b/frontend/src/app/admin/faculty/register/page.tsx index 239172a2..459f56b7 100644 --- a/frontend/src/app/admin/faculty/register/page.tsx +++ b/frontend/src/app/admin/faculty/register/page.tsx @@ -67,6 +67,8 @@ const Page = () => { } }; + return <div className="flex h-40 w-full items-center justify-center text-comment">개발 중인 기능입니다.</div>; + return ( <> <div className="mb-10 rounded-sm border-[1px] border-admin-border bg-admin-background-light px-5 py-3"> diff --git a/frontend/src/app/admin/member/list/page.tsx b/frontend/src/app/admin/member/list/page.tsx index 25e04b94..e6723a65 100644 --- a/frontend/src/app/admin/member/list/page.tsx +++ b/frontend/src/app/admin/member/list/page.tsx @@ -22,7 +22,8 @@ const Page = ({ searchParams }: { searchParams?: { [key: string]: string | undef return ( <div className="w-full"> - <div className="flex items-center rounded-sm border-[1px] border-admin-border bg-admin-background-light px-5 py-3 text-sm"> + <div className="flex h-40 w-full items-center justify-center text-comment">개발 중인 기능입니다.</div> + {/* <div className="flex items-center rounded-sm border-[1px] border-admin-border bg-admin-background-light px-5 py-3 text-sm"> <span className="mr-20"> 총 <span className="text-admin-primary-main">{members.length}</span>명의 회원이 있습니다. </span> @@ -34,7 +35,7 @@ const Page = ({ searchParams }: { searchParams?: { [key: string]: string | undef totalItems={members.length} pathname={pathname} query={JSON.stringify(searchParams)} - /> + /> */} </div> ); }; diff --git a/frontend/src/app/admin/team-building/page.tsx b/frontend/src/app/admin/team-building/page.tsx new file mode 100644 index 00000000..bf4f4cdf --- /dev/null +++ b/frontend/src/app/admin/team-building/page.tsx @@ -0,0 +1,9 @@ +const Page = () => { + return ( + <div className="w-full"> + <div className="flex h-40 w-full items-center justify-center text-comment">개발 중인 기능입니다.</div> + </div> + ); +}; + +export default Page; diff --git a/frontend/src/lib/hooks/useApi.ts b/frontend/src/lib/hooks/useApi.ts index be689651..b90360b1 100644 --- a/frontend/src/lib/hooks/useApi.ts +++ b/frontend/src/lib/hooks/useApi.ts @@ -286,3 +286,13 @@ export function useSignInMutation() { .catch((err) => Promise.reject(err)), }); } + +export function useResetPasswordMutation() { + return useAxiosMutation({ + mutationFn: async ({ email, name }: { email: string; name: string }) => + await client + .patch(`/sign-in/reset-password`, { email: email + '@pusan.ac.kr', name }) + .then((res) => res.data) + .catch((err) => Promise.reject(err)), + }); +}