Skip to content

Commit

Permalink
Merge pull request #19 from ananjaemin/4-api-page-๊ฐœ๋ฐœ
Browse files Browse the repository at this point in the history
4 api page ๊ฐœ๋ฐœ
  • Loading branch information
ananjaemin committed Nov 2, 2022
2 parents a9768dd + 3ef541c commit 57d9b22
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
17 changes: 10 additions & 7 deletions src/pages/api/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,16 @@ export const ApiPage: React.FC = () => {
await axios({
method: 'get',
url: 'https://tfb.minpeter.cf/info',
}).then((res) => {
console.log(res.data);
setApiInfo(res.data);
setTimeout(() => {
setLoading(true); //loading ํ™•์ธํ•˜๊ณ ์‹ถ์œผ๋ฉด false๋กœ ๋ฐ”๊ฟ”์ฃผ์„ธ์š”.
}, 1200);
});
})
.then((res) => {
setApiInfo(res.data);
setTimeout(() => {
setLoading(true); //loading ํ™•์ธํ•˜๊ณ ์‹ถ์œผ๋ฉด false๋กœ ๋ฐ”๊ฟ”์ฃผ์„ธ์š”.
}, 1200);
})
.catch((err) => {
console.log(err);
});
};

useEffect(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/postApi/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const ApiPostPage: React.FC = () => {
})
.then((res) => {
if (res.data?.message === 'invalid api name') {
navigate('/'); //๋‚˜์ค‘์— 404ํŽ˜์ด์ง€๋กœ ์ด๋™ํ•˜๊ฒŒ
navigate('/404'); //๋‚˜์ค‘์— 404ํŽ˜์ด์ง€๋กœ ์ด๋™ํ•˜๊ฒŒ
} else {
setApiInfo(res.data);
setTimeout(() => {
Expand Down

0 comments on commit 57d9b22

Please sign in to comment.