diff --git a/src/main/frontend/src/App.tsx b/src/main/frontend/src/App.tsx index 4d53b30..b15302b 100644 --- a/src/main/frontend/src/App.tsx +++ b/src/main/frontend/src/App.tsx @@ -1,4 +1,4 @@ -import {useCallback, useState} from 'react'; +import {useCallback, useEffect, useState} from 'react'; import {Button} from "@/components/ui/button"; import { Table, @@ -17,14 +17,14 @@ function App() { const navigate = useNavigate(); const getFakeAccounts = useCallback(() => { - fetch("http://localhost:8080/accounts") + fetch("/api/accounts") .then(response => response.json()) .then(data => setAccounts(data)) .catch(error => console.error(error)); }, [accounts]); const postFakeAccount = () => { - fetch("http://localhost:8080/account", { + fetch("/api/account", { method: "POST", headers: { "Content-Type": "application/json" @@ -42,6 +42,10 @@ function App() { .catch(error => console.error(error)); }; + useEffect(() => { + getFakeAccounts(); + }, []); + return (