Skip to content

Commit

Permalink
[fix] AuthModalLogic fix
Browse files Browse the repository at this point in the history
  • Loading branch information
subsub-e committed Aug 22, 2024
1 parent b19bce5 commit 80f53b0
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 80f53b0

Please sign in to comment.