Skip to content

Commit

Permalink
Merge pull request #157 from softeerbootcamp4th/feat/#156/AuthModalFix
Browse files Browse the repository at this point in the history
[fix] AuthModalLogic fix
  • Loading branch information
yoonc01 authored Aug 22, 2024
2 parents b19bce5 + 80f53b0 commit b0e742b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion service/src/components/modal/CommentModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function CommentModal({
>
<div className="px-1500 set-center gap-500">
<p>{data.phoneNumber}</p>
<div className="flex items-center">
<div className="flex items-center w-[50px]">
<div className="text-detail-2-regular text-neutral-500">
{likeCount}
</div>
Expand Down
17 changes: 8 additions & 9 deletions service/src/components/modal/PhoneAuthModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@ function PhoneAuthModal({
setIsValid(e.target.value.length === 6);
};
const handleAuth = async () => {
if (validateCode === '111111') {
try {
const response = await loginCode(inputPhone, validateCode);
try {
const response = await loginCode(inputPhone, validateCode);
if (response.code && response.code === 'CODE_INCORRECT') {
setAlertText('인증번호를 다시 확인해주세요!');
setIsValid(false);
} else {
localStorage.setItem('userInfo', response.accessToken);
setUserInfo(response);

if (option === '자동차 아이템') {
if (response.car) {
setResultModalOpen('alreadyGetCar');
Expand All @@ -37,12 +39,9 @@ function PhoneAuthModal({
setResultModalOpen('comment');
}
closeAuthModal();
} catch (error) {
console.error('API 통신 실패:', error);
}
} else {
setAlertText('인증번호를 다시 확인해주세요!');
setIsValid(false);
} catch (error) {
console.error('API 통신 실패:', error);
}
};
const firstClickEvent = () => {
Expand Down
1 change: 0 additions & 1 deletion service/src/pages/joinEvent/commentList/CommentDetail.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ function CommentDetail() {
}, [userInfo]);

if (loading) {
console.log('ddd');
return (
<div className="w-screen h-screen set-center bg-neutral-400">
<img src={Loading} alt="Loading" className="rotate-360" />
Expand Down

0 comments on commit b0e742b

Please sign in to comment.