fix: handle register response correctly
Docker Build and Push / build-and-push (push) Successful in 5m22s
Docker Build and Push / build-and-push (push) Successful in 5m22s
This commit is contained in:
+3
-11
@@ -1,13 +1,5 @@
|
|||||||
import type { Route } from "./+types/home";
|
import { redirect } from "react-router";
|
||||||
import { Welcome } from "../welcome/welcome";
|
|
||||||
|
|
||||||
export function meta({}: Route.MetaArgs) {
|
export function loader() {
|
||||||
return [
|
throw redirect("/forms");
|
||||||
{ title: "New React Router App" },
|
|
||||||
{ name: "description", content: "Welcome to React Router!" },
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
export default function Home() {
|
|
||||||
return <Welcome />;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -120,8 +120,6 @@ export async function register(email: string, password: string) {
|
|||||||
const data = await res.json().catch(() => null)
|
const data = await res.json().catch(() => null)
|
||||||
throw new Error(data?.message ?? "Registration failed")
|
throw new Error(data?.message ?? "Registration failed")
|
||||||
}
|
}
|
||||||
|
|
||||||
return res.json()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function logout() {
|
export async function logout() {
|
||||||
|
|||||||
Reference in New Issue
Block a user