From 08ea2d85306c8bbd753c3187168cc189ca2e4561 Mon Sep 17 00:00:00 2001 From: bagas Date: Sun, 22 Feb 2026 13:40:26 +0700 Subject: [PATCH] fix: handle register response correctly --- app/routes/home.tsx | 14 +++----------- lib/api.ts | 2 -- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/app/routes/home.tsx b/app/routes/home.tsx index 398e47c..700d14a 100644 --- a/app/routes/home.tsx +++ b/app/routes/home.tsx @@ -1,13 +1,5 @@ -import type { Route } from "./+types/home"; -import { Welcome } from "../welcome/welcome"; +import { redirect } from "react-router"; -export function meta({}: Route.MetaArgs) { - return [ - { title: "New React Router App" }, - { name: "description", content: "Welcome to React Router!" }, - ]; -} - -export default function Home() { - return ; +export function loader() { + throw redirect("/forms"); } diff --git a/lib/api.ts b/lib/api.ts index e9e3ae9..721b798 100644 --- a/lib/api.ts +++ b/lib/api.ts @@ -120,8 +120,6 @@ export async function register(email: string, password: string) { const data = await res.json().catch(() => null) throw new Error(data?.message ?? "Registration failed") } - - return res.json() } export async function logout() {