Skip to content

Commit

Permalink
feat: 주석 제거 및 로그인 로딩 1초로 줄임
Browse files Browse the repository at this point in the history
  • Loading branch information
fuzzfuzz20 committed Jun 14, 2023
1 parent 53d5b99 commit 8f21a97
Show file tree
Hide file tree
Showing 46 changed files with 91 additions and 466 deletions.
2 changes: 0 additions & 2 deletions components/games/LottoGame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ function LottoGame() {
}
})
.then((res) => {
console.log(res)
setGames(res.data)
console.log(games)
})
.catch((err) => {
console.log(err)
Expand Down
3 changes: 0 additions & 3 deletions components/games/RouletteGame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ const RouletteGame = () => {
}
})
.then((res) => {
console.log(res)
setGames(res.data)
console.log(games.data.rouletteDayCount)
})
.catch((err) => {
console.log(err)
Expand Down Expand Up @@ -95,7 +93,6 @@ const RouletteGame = () => {
},
})
.then((res) => {
console.log(res)
setGames(prevGames => ({
...prevGames,
data: {
Expand Down
1 change: 0 additions & 1 deletion components/layouts/header/WebtoonHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ export default function WebtoonHeader() {
}
})
.then((res) => {
console.log(res);
setLike(true);
})
.catch((err) => {
Expand Down
2 changes: 1 addition & 1 deletion components/modals/LoginGuide.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default function LoginGuide() {
// 3초 후에 페이지 이동
setTimeout(() => {
router.push('/login');
}, 3000);
}, 1000);
}, []);

return (
Expand Down
9 changes: 0 additions & 9 deletions components/pages/authorregister/AuthorNicknameAgreement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,17 @@ interface ChildProps {
export default function AuthorNicknameAgreement({ inputData, setInputData, signupbtn }: ChildProps) {

const router = useRouter();
console.log(inputData.creatorNickname)

const { data: session } = useSession()
// const role = sessionStorage.getItem('role');

const handleAuthorSignup = async () => {

try {
const formData = new FormData();
formData.append("creatorNickname", inputData.creatorNickname);

console.log(inputData.creatorNickname)
console.log(session)

//put - formdata 못 넣음. 데이터를 넣을때 사용.

console.log(formData.get('creatorNickname'))

const res = await fetch('https://blockpage.site/member-service/v1/members?type=author', {
method: 'PUT',
body: formData,
Expand All @@ -43,7 +36,6 @@ export default function AuthorNicknameAgreement({ inputData, setInputData, signu
})

const data = await res.json()
console.log(data)
if (data) {
Swal.fire({
icon: 'success',
Expand All @@ -61,7 +53,6 @@ export default function AuthorNicknameAgreement({ inputData, setInputData, signu
})
}
} catch (err) {
console.log(err)
Swal.fire({
icon: 'success',
title: '작가 등록에 실패하였습니다.',
Expand Down
1 change: 0 additions & 1 deletion components/pages/authorregister/AuthorRegister.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ export default function AuthorRegister({ inputData, setInputData, setsignupbtn }
}
})
.then((res) => {
console.log(res)
Swal.fire({
icon: 'success',
title: '사용 가능한 작가명입니다.',
Expand Down
7 changes: 0 additions & 7 deletions components/pages/authorworkslist/AuthorSubCategory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ export default function AuthorSubCategory({ active, defaultActive }: { active: s
}]
});

console.log(webtoonList)

const [WebtoonStatus, setWebtoonStatus] = useState<WebtoonStatusData>({
data: {
webtoonStatus: '',
Expand All @@ -50,7 +48,6 @@ export default function AuthorSubCategory({ active, defaultActive }: { active: s
})
.then((res) => {
setWebtoonList(res.data)
console.log(res.data)
setWebtoonStatus(res.data)
})
.catch((err) => {
Expand All @@ -66,8 +63,6 @@ export default function AuthorSubCategory({ active, defaultActive }: { active: s
router.push(`/authorworkslist/${webtoonId}/changewebtoon`);
};

console.log(webtoonList.data)

const handleDeleteWebtoonClick = (webtoonTitle: string, WebtoonStatus: string) => {

const formData = new FormData();
Expand All @@ -82,7 +77,6 @@ export default function AuthorSubCategory({ active, defaultActive }: { active: s
},
})
.then((res) => {
console.log(res)
Swal.fire({
icon: 'success',
title: '삭제되었습니다.',
Expand All @@ -97,7 +91,6 @@ export default function AuthorSubCategory({ active, defaultActive }: { active: s
console.log(err)
})
};
console.log(session?.email)

const getGenreTypeString = (genre: number) => {
if (genre === 0) {
Expand Down
2 changes: 0 additions & 2 deletions components/pages/blockcharge/BlockCharge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,9 @@ export default function BlockCharge() {
headers: {
'Content-Type': 'application/json',
memberId: session?.email,
// role: role,
},
});

console.log(response.data.data);
window.location.href = response.data.data.nextRedirectPcUrl;
}
catch (error) {
Expand Down
6 changes: 0 additions & 6 deletions components/pages/blockpurchase/TransactionHistory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ const TransectionHistory = () => {
})
.then((res) => {
setChargeBlock(res.data)
console.log(chargeBlock)
setRefund(res.data)
})
.catch((err) => {
Expand All @@ -84,12 +83,8 @@ const TransectionHistory = () => {
},
})
.then((res) => {
console.log(res)
setChargeBlock(res.data)
console.log(chargeBlock)
setRefund(res.data)
console.log(refund)
console.log(res.data)
})
.catch((err) => {
console.log(err)
Expand Down Expand Up @@ -132,7 +127,6 @@ const TransectionHistory = () => {
}
})
.then((res) => {
console.log(res)
if (res.status === 200) {
Swal.fire({
icon: 'success',
Expand Down
20 changes: 0 additions & 20 deletions components/pages/changeepisode/ChangeEpisodeInfoForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,6 @@ export default function ChangeEpisodeInfoForm() {
const [episodeImagePreview, setEpisodeImagePreview] = useState<UploadFile[]>([]);
const regex = new RegExp("(.*?)\.(exe|sh|zip|alz)$");

// useEffect(() => {
// axios(`/api/authorwebtooninfo/${router.query.id}`)
// .then(res => res.data)
// .then(data => {
// setEpisodeInfoData(data);
// setEpisodeThumbnailImagePreview(data.episodeThumbnail);
// setEpisodeImagePreview(data.episodeImage.map((url: string, index: number) => ({
// name: `Episode ${index + 1}`,
// preview: url,
// file: null,
// })));
// })
// }, [episodeInfoData, router.query.id])

console.log(episodeInfoData)

useEffect(() => {
axios.get(`https://blockpage.site/webtoon-service/v1/episodes/creator?${webtoonId}`,
{
Expand All @@ -69,8 +53,6 @@ export default function ChangeEpisodeInfoForm() {
})
.then((res) => {
setEpisodeInfoData(res.data)
console.log(res.data)
console.log(episodeInfoData)
})
.catch((err) => {
console.log(err)
Expand Down Expand Up @@ -171,8 +153,6 @@ export default function ChangeEpisodeInfoForm() {
memberId: session?.email || '',
},
});

console.log(res);
if (res.status === 201) {
Swal.fire({
title: '요청 성공!',
Expand Down
10 changes: 2 additions & 8 deletions components/pages/changeuserinfo/ChangeUserInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ export default function ChangeUserInfo() {

useEffect(() => {
const fetchData = async () => {
console.log(session?.email)
try {
const res = await axios.get('https://blockpage.site/member-service/v1/members?type=detail', {
headers: {
Expand All @@ -69,7 +68,6 @@ export default function ChangeUserInfo() {
profileSkin,
}
});
console.log(res.data)

const res2 = await axios.get("https://blockpage.site/purchase-service/v1/purchases?type=profileSkin", {
headers: {
Expand All @@ -78,9 +76,8 @@ export default function ChangeUserInfo() {
},
})
setChangeProfileSkin(res2.data);
console.log(res2.data.data)
} catch (e) {
console.log(e);
} catch (err) {
console.log(err);
}
}
fetchData();
Expand All @@ -103,7 +100,6 @@ export default function ChangeUserInfo() {
};

const handleProfileSkinSubmit = () => {
console.log(check)
axios.put('https://blockpage.site/purchase-service/v1/purchases?type=profileSkin', {
memberProfileSkinId: check,
}, {
Expand All @@ -113,7 +109,6 @@ export default function ChangeUserInfo() {
},
})
.then((res) => {
console.log(res.data)
Swal.fire({
icon: 'success',
title: '변경되었습니다.',
Expand Down Expand Up @@ -171,7 +166,6 @@ export default function ChangeUserInfo() {
},
})
.then((res) => {
console.log(res.data)
Swal.fire({
icon: 'success',
title: '변경되었습니다.',
Expand Down
8 changes: 0 additions & 8 deletions components/pages/changewebtoon/ChangeWebtoonForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,36 +63,29 @@ export default function ChangeWebtoonForm() {
},
})
.then((res) => {
console.log(res)
const selectedWebtoon = res.data.data.find((webtoon: any) => webtoon.webtoonId === Number(webtoonId));
if (selectedWebtoon) {
setWebtoonData({
data: [selectedWebtoon],
})
}
console.log(res.data.data)
console.log(webtoonData)
if (selectedWebtoon) {
setAuthorName({
data: selectedWebtoon.creator,
});
}
console.log(authorName)
})
.catch((err) => {
console.log(err)
})
}, [])

console.log(webtoonData)

const handleInput = (e: React.ChangeEvent<HTMLSelectElement | HTMLInputElement>) => {
const { name, value } = e.target;
setWebtoonInfoData({
...webtoonInfoData,
[name]: Number(value) || value,
});
console.log(webtoonInfoData)
};

const handleMainImage = (e: React.ChangeEvent<HTMLInputElement>) => {
Expand Down Expand Up @@ -170,7 +163,6 @@ export default function ChangeWebtoonForm() {
},
)
.then((res) => {
console.log(res)
Swal.fire({
icon: 'success',
title: '요청 성공!',
Expand Down
3 changes: 0 additions & 3 deletions components/pages/chargeresult/ChargeResultSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export default function ChargeResultSection() {

const router = useRouter();
const pgToken = router.query.pg_token;
console.log(pgToken)

const handlego = async () => {
axios.post('https://blockpage.site/block-service/v1/payments?type=kakao-approve', {
Expand All @@ -28,7 +27,6 @@ export default function ChargeResultSection() {
}
)
.then((res) => {
console.log(res.data.data)
const orderlist = res.data.data
axios.post('https://blockpage.site/block-service/v1/blocks?type=cash', {
orderId: orderlist.orderId,
Expand All @@ -41,7 +39,6 @@ export default function ChargeResultSection() {
},
})
.then((res) => {
console.log(res)
router.push('/completepayment')
localStorage.setItem('orderdata', JSON.stringify(orderlist))
})
Expand Down
2 changes: 0 additions & 2 deletions components/pages/chargeresult/CompletePayMentSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ export default function CompletePayMentSection() {
}
);


console.log(orderdata)
useEffect(() => {
const orderlist = localStorage.getItem('orderdata') as string;
setOrderData(JSON.parse(orderlist))
Expand Down
Loading

0 comments on commit 8f21a97

Please sign in to comment.