diff options
Diffstat (limited to 'web/app/page.tsx')
| -rw-r--r-- | web/app/page.tsx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/web/app/page.tsx b/web/app/page.tsx index 2df40508..b78fe389 100644 --- a/web/app/page.tsx +++ b/web/app/page.tsx @@ -1,7 +1,16 @@ +"use client"; + +import { useCallback } from "react"; import { LoginButton } from "../components/auth/login"; import { LogoutButton } from "../components/auth/logout"; export default function Home() { + const addUrl = useCallback(async () => { + await fetch("/api/v1/links", { + method: "POST", + body: JSON.stringify({ url: "https://news.ycombinator.com/news" }), + }); + }, []); return ( <main className="flex min-h-screen flex-col items-center justify-between p-24"> <div> @@ -9,6 +18,9 @@ export default function Home() { <br /> <br /> <LogoutButton /> + <br /> + <br /> + <button onClick={addUrl}>Add URL</button> </div> </main> ); |
