diff --git a/src/api/hooks/Mail/useGetMail.tsx b/src/api/hooks/Mail/useGetMail.tsx index 705e55b..9dd012e 100644 --- a/src/api/hooks/Mail/useGetMail.tsx +++ b/src/api/hooks/Mail/useGetMail.tsx @@ -8,7 +8,6 @@ export const getMailPath = (page: number, size: number) => const createApiClient = (job: string) => { const token = sessionStorage.getItem('accessToken'); - console.log(job); return axios.create({ baseURL: BASE_URL, headers: { diff --git a/src/api/hooks/Mail/useGoMail.tsx b/src/api/hooks/Mail/useGoMail.tsx index ccad041..80153f8 100644 --- a/src/api/hooks/Mail/useGoMail.tsx +++ b/src/api/hooks/Mail/useGoMail.tsx @@ -31,10 +31,10 @@ export const useGoMail = () => { const { mutate } = useMutation({ mutationFn: goMail, onSuccess: (result) => { - console.log('Mail send successfully:', result); + alert('πŸ“¨ 메일을 λ³΄λƒˆμŠ΅λ‹ˆλ‹€!'); }, onError: (error) => { - console.error('Error sending mail:', error); + alert('⚠️ 메일 보내기에 μ‹€νŒ¨ν•˜μ˜€μŠ΅λ‹ˆλ‹€!'); }, }); return { mutate }; diff --git a/src/api/hooks/Mail/usePostMail.tsx b/src/api/hooks/Mail/usePostMail.tsx index c76d829..0fcd1c5 100644 --- a/src/api/hooks/Mail/usePostMail.tsx +++ b/src/api/hooks/Mail/usePostMail.tsx @@ -31,10 +31,10 @@ export const usePostMail = () => { const { mutate } = useMutation({ mutationFn: postMail, onSuccess: (result) => { - console.log('Mail posted successfully:', result); + alert('πŸ“¨ μ €μž₯이 μ™„λ£Œλ˜μ—ˆμŠ΅λ‹ˆλ‹€!'); }, onError: (error) => { - console.error('Error posting mail:', error); + alert('⚠️ μ €μž₯에 μ‹€νŒ¨ν•˜μ˜€μŠ΅λ‹ˆλ‹€'); }, }); return { mutate }; diff --git a/src/api/hooks/useGetLogin.tsx b/src/api/hooks/useGetLogin.tsx index aec25d1..16622e9 100644 --- a/src/api/hooks/useGetLogin.tsx +++ b/src/api/hooks/useGetLogin.tsx @@ -12,7 +12,6 @@ export const getLoginPath = (code: string) => `${BASE_URL}/google/login/redirect export const getLogin = async ({ code }: AuthResponse): Promise => { try { const response = await axios.get(getLoginPath(code)); - console.log(response.data); return response.data; } catch (error) { console.error('Error during login:', error); diff --git a/src/components/HomePage/TestersBox/Buttons.tsx b/src/components/HomePage/TestersBox/Buttons.tsx index 17d2789..93357ad 100644 --- a/src/components/HomePage/TestersBox/Buttons.tsx +++ b/src/components/HomePage/TestersBox/Buttons.tsx @@ -40,7 +40,6 @@ export const Buttons = ({ handleListUniv, handleListBusiness, randomInput }: But { ...(randomInput as unknown as mailSendUniv) }, { onSuccess: (data) => { - console.log(data); setTitle(data.title || '메일 생성 성곡'); setContent(data.content || '메일이 μ„±κ³΅μ μœΌλ‘œ μƒμ„±λ˜μ—ˆμŠ΅λ‹ˆλ‹€.'); }, @@ -59,7 +58,6 @@ export const Buttons = ({ handleListUniv, handleListBusiness, randomInput }: But { ...(randomInput as unknown as mailSendBusiness) }, { onSuccess: (data) => { - console.log(data); setTitle(data.title || '메일 생성 성곡'); setContent(data.content || '메일이 μ„±κ³΅μ μœΌλ‘œ μƒμ„±λ˜μ—ˆμŠ΅λ‹ˆλ‹€.'); }, diff --git a/src/components/Mail/MailModal.tsx b/src/components/Mail/MailModal.tsx index 92b7972..634f96e 100644 --- a/src/components/Mail/MailModal.tsx +++ b/src/components/Mail/MailModal.tsx @@ -98,13 +98,10 @@ export const MailModal = ({ isOpen, onOpen, onClose }: MailModalProps) => { content: data.content, }; - console.log(univData); - univMutate( { ...(univData as unknown as mailSendUniv) }, { onSuccess: (data) => { - console.log(data); setTitle(data.title || '메일 생성 성곡'); setContent(data.content || '메일이 μ„±κ³΅μ μœΌλ‘œ μƒμ„±λ˜μ—ˆμŠ΅λ‹ˆλ‹€.'); setIsSubmitted(true); @@ -142,13 +139,10 @@ export const MailModal = ({ isOpen, onOpen, onClose }: MailModalProps) => { content: data.content, }; - console.log(businessData); - businessMutate( { ...(businessData as unknown as mailSendBusiness) }, { onSuccess: (data) => { - console.log(data); setTitle(data.title || '메일 생성 성곡'); setContent(data.content || '메일이 μ„±κ³΅μ μœΌλ‘œ μƒμ„±λ˜μ—ˆμŠ΅λ‹ˆλ‹€.'); setIsSubmitted(true); @@ -217,7 +211,6 @@ export const MailModal = ({ isOpen, onOpen, onClose }: MailModalProps) => { const handlePutMail = () => { if (authInfo) { mailmutate({ ...mailResult }); - alert('πŸ“¨ μ €μž₯이 μ™„λ£Œλ˜μ—ˆμŠ΅λ‹ˆλ‹€!'); } else { alert('둜그인 ν›„ 메일을 μ €μž₯ ν•  수 μžˆμŠ΅λ‹ˆλ‹€.'); } @@ -226,19 +219,23 @@ export const MailModal = ({ isOpen, onOpen, onClose }: MailModalProps) => { const handleGoMail = () => { const recipientEmail = prompt('λ°›λŠ” μ‚¬λžŒμ˜ 이메일 μ£Όμ†Œλ₯Ό μž…λ ₯ν•΄ μ£Όμ„Έμš”:'); + const emailPattern = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; if (authInfo) { const myMailAddress = sessionStorage.getItem('email'); if (recipientEmail) { - const mailGoContent = { - to: recipientEmail, - from: myMailAddress as string, - subject: mailResult.subject, - body: mailResult.body, - }; - mailGo({ ...mailGoContent }); - alert('πŸ“¨ 메일을 λ³΄λƒˆμŠ΅λ‹ˆλ‹€!'); + if (emailPattern.test(recipientEmail)) { + const mailGoContent = { + to: recipientEmail, + from: myMailAddress as string, + subject: mailResult.subject, + body: mailResult.body, + }; + mailGo({ ...mailGoContent }); + } else { + alert('μœ νš¨ν•œ 이메일 μ£Όμ†Œλ₯Ό μž…λ ₯ν•΄ μ£Όμ„Έμš”.'); + } } else { alert('μœ νš¨ν•œ 이메일 μ£Όμ†Œλ₯Ό μž…λ ₯ν•΄ μ£Όμ„Έμš”.'); } @@ -380,7 +377,6 @@ export const MailModal = ({ isOpen, onOpen, onClose }: MailModalProps) => { ) : ( { - console.log('Form submitted', data); if (isActive === 'univ') { setMailInputUniv(data as mailSendUniv); } else { diff --git a/src/pages/Login/AuthPage.tsx b/src/pages/Login/AuthPage.tsx index 2ccd865..b5b211c 100644 --- a/src/pages/Login/AuthPage.tsx +++ b/src/pages/Login/AuthPage.tsx @@ -16,8 +16,6 @@ export const AuthPage = () => { useEffect(() => { if (data && !error) { - console.log('data', data); - updateAuthInfo({ accessToken: data.accessToken, picture: data.picture, diff --git a/src/routes/components/PrivateRoute.tsx b/src/routes/components/PrivateRoute.tsx index 74a6a9f..2465392 100644 --- a/src/routes/components/PrivateRoute.tsx +++ b/src/routes/components/PrivateRoute.tsx @@ -7,9 +7,6 @@ export const PrivateRoute = () => { if (!authInfo) { return ; - } else { - console.log(authInfo.accessToken); } - return ; };