Skip to content

Commit

Permalink
Merge pull request #56 from Moaguide-develop/feat/mainpage
Browse files Browse the repository at this point in the history
remove: console log 제거
  • Loading branch information
jiohjung98 authored Oct 9, 2024
2 parents 53ed475 + 0076498 commit cfa5288
Show file tree
Hide file tree
Showing 21 changed files with 44 additions and 108 deletions.
20 changes: 8 additions & 12 deletions src/app/mypage/edit/changephone/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,39 +38,35 @@ const ChangePhonePage = () => {
const handleRequest = async () => {
try {
const data = await sendVerificationCode(phoneNumber);
console.log('인증 요청 성공:', data);
setIsRequest(true); // 요청 상태 true
setValidTime(300); // 인증 요청 시 타이머 초기화
setIsRequest(true);
setValidTime(300);
} catch (error) {
console.error('인증 요청 실패:', error);
setIsRequest(false); // 요청 실패 시 상태 초기화
setIsRequest(false);
}
};

const handleResending = async () => {
if (isComplete) return;
try {
const data = await sendVerificationCode(phoneNumber);
console.log('인증 재요청 성공:', data);
setValidNumber('');
inputRef.current?.focus();
setIsRequest(true); // 요청 상태 true
setValidTime(300); // 인증 요청 시 타이머 초기화
setIsRequest(true);
setValidTime(300);
} catch (error) {
console.error('인증 재요청 실패:', error);
}
};

const handleCertify = async () => {
if (isComplete) return; // 이미 인증 완료된 상태면 return
if (isComplete) return;
try {
const data = await verifyCode(phoneNumber, validNumber);
console.log('인증 완료:', data);
setIsComplete(true); // 인증 검사 통과
setIsComplete(true);
setIsError(false);
} catch (error) {
console.error('인증 실패:', error);
setIsError(true); // 인증 검사 실패
setIsError(true);
}
};

Expand Down
1 change: 0 additions & 1 deletion src/app/mypage/edit/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ const Editpage = () => {
const checkNameDuplicate = async () => {
try {
const response = await checkNicknameAvailability(nameValue);
console.log(response)
if (response) {
setIsNameComplete('yes');
} else {
Expand Down
2 changes: 0 additions & 2 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ const HomePage = () => {
const user = JSON.parse(parsedUser.user);
setCookie('access_token', accessToken);


console.log('유저 정보', user);
setMember({
memberEmail: user.email,
memberNickName: user.nickname,
Expand Down
4 changes: 0 additions & 4 deletions src/app/payment/check/confirm/success/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,6 @@ async function getPayment({ paymentKey, orderId, amount }: PaymentRequestProps)
}
);

if (payment) {
console.log(payment);
}

return {
payment: payment
};
Expand Down
6 changes: 1 addition & 5 deletions src/app/signup/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ const SignupPage: React.FC = () => {

const handleSubmit = async () => {
try {
console.log('최종 제출 데이터:', formData);

const accessToken = getCookie('access_token');

if (!accessToken) {
Expand All @@ -88,9 +86,7 @@ const SignupPage: React.FC = () => {
Verify: accessToken,
};

const response = await finalSignup(formData, authHeaders);
console.log('서버 응답 데이터:', response);

await finalSignup(formData, authHeaders);
router.push('/');
} catch (error) {
console.error('서버 요청 오류:', error);
Expand Down
1 change: 0 additions & 1 deletion src/components/education/RoadMapItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ const RoadMapItem = ({
roadmap,
setRoadmap
}: RoadMapItemType) => {
console.log(subRoadmapData);

return (
<div>
Expand Down
25 changes: 11 additions & 14 deletions src/components/find/FindEmail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,40 +36,37 @@ const FindEmail = () => {

const handleRequest = async () => {
try {
const data = await sendVerificationCode(phoneNumber);
console.log('인증 요청 성공:', data);
setIsRequest(true); // 요청 상태 true
setValidTime(300); // 인증 요청 시 타이머 초기화
await sendVerificationCode(phoneNumber);
setIsRequest(true);
setValidTime(300);
} catch (error) {
console.error('인증 요청 실패:', error);
setIsRequest(false); // 요청 실패 시 상태 초기화
setIsRequest(false);
}
};

const handleResending = async () => {
if (isComplete) return;
try {
const data = await sendVerificationCode(phoneNumber);
console.log('인증 재요청 성공:', data);
await sendVerificationCode(phoneNumber);
setValidNumber('');
inputRef.current?.focus();
setIsRequest(true); // 요청 상태 true
setValidTime(300); // 인증 요청 시 타이머 초기화
setIsRequest(true);
setValidTime(300);
} catch (error) {
console.error('인증 재요청 실패:', error);
}
};

const handleCertify = async () => {
if (isComplete) return; // 이미 인증 완료된 상태면 return
if (isComplete) return;
try {
const data = await verifyCode(phoneNumber, validNumber);
console.log('인증 완료:', data);
setIsComplete(true); // 인증 검사 통과
await verifyCode(phoneNumber, validNumber);
setIsComplete(true);
setIsError(false);
} catch (error) {
console.error('인증 실패:', error);
setIsError(true); // 인증 검사 실패
setIsError(true);
}
};

Expand Down
11 changes: 3 additions & 8 deletions src/components/find/FindPassword.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,8 @@ const FindPassword = () => {
};

const handleRequest = async () => {
console.log('요청함');
try {
const data = await sendEmail(email);
console.log('인증 요청 성공:', data);
await sendEmail(email);
setIsRequest(true);
setValidTime(300);
} catch (error) {
Expand All @@ -45,8 +43,7 @@ const FindPassword = () => {
const handleResending = async () => {
if (isComplete) return;
try {
const data = await sendEmail(email);
console.log('인증 재요청 성공:', data);
await sendEmail(email);
setVerificationCode('');
inputRef.current?.focus();
setIsRequest(true);
Expand All @@ -59,8 +56,7 @@ const FindPassword = () => {
const handleCertify = async () => {
if (isComplete) return;
try {
const data = await verifyEmailCode(email, verificationCode);
console.log('인증 완료:', data);
await verifyEmailCode(email, verificationCode);
setIsComplete(true);
setIsError(false);
} catch (error) {
Expand Down Expand Up @@ -119,7 +115,6 @@ const FindPassword = () => {
if (passwordMatch && passwordValid) {
try {
await changePasswordinFind(email, password);
console.log('비밀번호 재설정 성공');
} catch (error) {
console.error('비밀번호 재설정 실패:', error);
}
Expand Down
3 changes: 0 additions & 3 deletions src/components/practice/CategoryPracticeItem.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import type { StudyGuidesItem, SubLoadmap } from '@/types/homeComponentsType';
import React from 'react';
import { useRouter } from 'next/navigation';

const CategoryPracticeItem = ({ id, title, link }: StudyGuidesItem) => {
const router = useRouter();

const handleClick = () => {
console.log(link);
window.open(link, '_blank');
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import Image from 'next/image';
const CategorySubloadmapBottomArticle: React.FC<InvestmentGuideProps> = ({ id, title, description, date, imageLink, link }) => {

const handleClick = () => {
console.log(link);
window.open(link, '_blank');
};

Expand Down
2 changes: 0 additions & 2 deletions src/components/product/Dividend.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import SwiperCore from 'swiper';
import 'swiper/css';
import 'swiper/css/navigation';
import 'swiper/css/pagination';
// import SwiperCore, { Navigation } from 'swiper/core';
import Image from 'next/image';
import { memo, useState } from 'react';
import { IDivide } from '@/types/Diviend';
Expand Down Expand Up @@ -71,7 +70,6 @@ const Dividend = memo(({ dividend }: DividendProps) => {
}}
className="mySwiper flex justify-center">
{dividend?.map((item) => {
console.log(item?.product_Id);
return (
<div key={item.product_Id}>
<SwiperSlide className=" flex ">
Expand Down
1 change: 0 additions & 1 deletion src/components/product/ProductClassification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ const ProductClassification = ({
const params = new URLSearchParams(searchParams.toString());
const router = useRouter();
const sorted = searchParams.get('subcategory');
console.log(sorted);

const handleClick = (key: string, key2: string) => {
params.set('subcategory', key);
Expand Down
2 changes: 0 additions & 2 deletions src/components/recentlyIssue/BestNews.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ import { Pagination, Autoplay } from 'swiper/modules';
const BestNews = () => {
const { data, isLoading } = getRecentlyIssues();

console.log('최신뉴스', data);

return (
<div className="pt-5 sm:pt-[28px] pb-[28px] max-w-[1000px] w-[90%] lg:w-full mx-auto">
<div className="text-heading4">👀 오늘 가장 많이 본 뉴스</div>
Expand Down
1 change: 0 additions & 1 deletion src/components/signup/Step4.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ const Step4: React.FC<StepProps> = ({ onNext, onUpdate }) => {
if (isFormValid) {
try {
await onNext();
console.log('가입성공');
router.push('/sign');
} catch (error) {
console.error('가입 처리 중 오류 발생:', error);
Expand Down
45 changes: 21 additions & 24 deletions src/components/signup/modal/PhoneVerification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ interface PhoneVerificationProps {
}

const PhoneVerification: React.FC<PhoneVerificationProps> = ({ onNext, onPhoneNumberChange }) => {
const [phoneNumber, setPhoneNumber] = useState<string>(''); // 전화번호
const [phoneNumberValid, setPhoneNumberValid] = useState(false); // 전화번호 유효성 검사
const [isRequest, setIsRequest] = useState(false); // 전화번호 입력 후 인증요청 상태
const [validNumber, setValidNumber] = useState<string>(''); // 인증번호
const [validNumberOk, setValidNumberOk] = useState(false); // 인증번호 유효성 검사
const [isComplete, setIsComplete] = useState(false); // 인증번호 인증 성공
const [isError, setIsError] = useState(false); // 인증번호 인증 실패
const [validTime, setValidTime] = useState<number>(300); // 인증 시간
const [phoneNumber, setPhoneNumber] = useState<string>('');
const [phoneNumberValid, setPhoneNumberValid] = useState(false);
const [isRequest, setIsRequest] = useState(false);
const [validNumber, setValidNumber] = useState<string>('');
const [validNumberOk, setValidNumberOk] = useState(false);
const [isComplete, setIsComplete] = useState(false);
const [isError, setIsError] = useState(false);
const [validTime, setValidTime] = useState<number>(300);
const inputRef = useRef<HTMLInputElement>(null);

const router = useRouter();
Expand All @@ -28,7 +28,7 @@ const PhoneVerification: React.FC<PhoneVerificationProps> = ({ onNext, onPhoneNu
.replace(/^(\d{0,3})(\d{0,4})(\d{0,4})$/g, '$1-$2-$3')
.replace(/(-{1,2})$/g, '');
setPhoneNumber(regex);
onPhoneNumberChange(regex); // 호출 추가
onPhoneNumberChange(regex);
};

const handleValidNumberChange = (e: ChangeEvent<HTMLInputElement>) => {
Expand All @@ -39,48 +39,45 @@ const PhoneVerification: React.FC<PhoneVerificationProps> = ({ onNext, onPhoneNu
const handleRequest = async () => {
try {
const plainPhoneNumber = phoneNumber.replace(/-/g, '');
const data = await sendVerificationCode(plainPhoneNumber);
console.log('인증 요청 성공:', data);
setIsRequest(true); // 요청 상태 true
setValidTime(300); // 인증 요청 시 타이머 초기화
await sendVerificationCode(plainPhoneNumber);
setIsRequest(true);
setValidTime(300);
} catch (error) {
console.error('인증 요청 실패:', error);
setIsRequest(false); // 요청 실패 시 상태 초기화
setIsRequest(false);
}
};

const handleResending = async () => {
if (isComplete) return;
try {
const plainPhoneNumber = phoneNumber.replace(/-/g, '');
const data = await sendVerificationCode(plainPhoneNumber);
console.log('인증 재요청 성공:', data);
await sendVerificationCode(plainPhoneNumber);
setValidNumber('');
inputRef.current?.focus();
setIsRequest(true); // 요청 상태 true
setValidTime(300); // 인증 요청 시 타이머 초기화
setIsRequest(true);
setValidTime(300);
} catch (error) {
console.error('인증 재요청 실패:', error);
}
};

const handleCertify = async () => {
if (isComplete) return; // 이미 인증 완료된 상태면 return
if (isComplete) return;
try {
const plainPhoneNumber = phoneNumber.replace(/-/g, '');
const data = await verifyCode(plainPhoneNumber, validNumber);
console.log('인증 완료:', data);
setIsComplete(true); // 인증 검사 통과
await verifyCode(plainPhoneNumber, validNumber);
setIsComplete(true);
setIsError(false);
} catch (error) {
console.error('인증 실패:', error);
setIsError(true); // 인증 검사 실패
setIsError(true);
}
};

const handleComplete = () => {
if (isComplete) {
onNext(); // 인증 완료 후 다음 단계로 이동
onNext();
}
};

Expand Down
1 change: 0 additions & 1 deletion src/factory/ReportIssue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import axios from 'axios';

const fetchReportIssues = async () => {
const { data } = await axios.get(`https://api.moaguide.com/`);
console.log('최신이슈', data);
return data;
};

Expand Down
3 changes: 0 additions & 3 deletions src/factory/ReportLists.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ export const getStudyGuides = (category: string, subCategory: string, sort: stri
const fetchArticleList = async ({ pageParam = null }) => {
const url = pageParam ? `https://api.moaguide.com/study/article?nextCursor=${pageParam}` : 'https://api.moaguide.com/study/article';

console.log("Fetching next page with nextCursor:", pageParam);

const { data } = await axios.get(url);

return {
Expand All @@ -57,7 +55,6 @@ export const getArticles = () => {
queryKey,
queryFn: fetchArticleList,
getNextPageParam: (lastPage) => {
console.log("Last page:", lastPage);
return lastPage.isLast ? undefined : lastPage.nextPage;
},
initialPageParam: null,
Expand Down
1 change: 0 additions & 1 deletion src/factory/useNewsList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const fetchNewsList = async ({
pageParam: number;
}) => {
const [, category] = queryKey;
console.log('category', category);
const { data } = await axios.get(
`https://api.moaguide.com/detail/news/${category}?page=${pageParam}&size=10`
);
Expand Down
Loading

0 comments on commit cfa5288

Please sign in to comment.