From 0d1352d8122b2f328a943be93512359cafc99513 Mon Sep 17 00:00:00 2001 From: Phill Pover Date: Mon, 31 Mar 2025 17:49:48 +0100 Subject: [PATCH] Rendering blogpost items --- frontend/src/App.tsx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index d47d4ea..8a2f79f 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -7,9 +7,17 @@ function App() { const [message, setMessage] = useState(''); useEffect(() => { - axios.get('https://api.anatid.net/') + axios.get('https://api.anatid.net/blogposts') .then(response => { - setMessage(response.data); + const blogpostItems = response.data.map(blogpost => +
  • + {blogpost.title} + +
  • + ) + setMessage(blogpostItems); }) .catch(error => { console.error('There was an error fetching the data.', error); @@ -21,7 +29,7 @@ function App() {
    logo

    React is working

    -

    {message}

    +
    );