diff options
| author | realtradam <[email protected]> | 2024-07-27 02:00:57 -0400 |
|---|---|---|
| committer | realtradam <[email protected]> | 2024-07-27 02:00:57 -0400 |
| commit | de3d80ce3ea20a869d700c3238020d44059de099 (patch) | |
| tree | ef849326ea4922530990d5dc29cb8ff3532e82fe /frontend/src/pages/Article.tsx | |
| parent | 6b342f97f6a605b7e1fe34584abbbf962ca39b7c (diff) | |
| download | spring-blog-de3d80ce3ea20a869d700c3238020d44059de099.tar.gz spring-blog-de3d80ce3ea20a869d700c3238020d44059de099.zip | |
working login and auth
Diffstat (limited to 'frontend/src/pages/Article.tsx')
| -rw-r--r-- | frontend/src/pages/Article.tsx | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/frontend/src/pages/Article.tsx b/frontend/src/pages/Article.tsx deleted file mode 100644 index b367811..0000000 --- a/frontend/src/pages/Article.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import { useState, useEffect } from "react"; -import { useParams } from "react-router-dom"; - -export default function Article () { - const { id } = useParams(); - const [articleData, setArticleData] = useState<any>(); - - useEffect(() => { - const url = `${import.meta.env.VITE_API_TITLE}/api/v1/article/${id}`; - fetch(url).then((response) => { - if (response.ok) { - return response.json(); - } - throw new Error("Network response was not ok."); - }).then((response) => setArticleData(response)); //.catch(() => navigate("/")); - }, [id]); - - return( - <> - <h1>{articleData?.title}</h1> - <div>{articleData?.content}</div> - </> - ); - -} |
