This commit is contained in:
2025-08-17 21:44:37 -03:00
parent 401a81afa0
commit 13f1479394
4 changed files with 5 additions and 6 deletions

View File

@@ -1,2 +1,3 @@
export const FOUND = 302
export const BAD_REQUEST = 400
export const INTERNAL_SERVER = 500

View File

@@ -31,6 +31,7 @@ export async function loader({ request, context }: Route.LoaderArgs) {
})
if (r.status === httpStatus.BAD_REQUEST) {
console.log(r)
return new Response(null, {
status: httpStatus.FOUND,
headers: {
@@ -44,6 +45,6 @@ export async function loader({ request, context }: Route.LoaderArgs) {
headers: r.headers
})
} catch {
return new Response(null, { status: 500 })
return new Response(null, { status: httpStatus.INTERNAL_SERVER })
}
}

View File

@@ -54,7 +54,7 @@ export async function action({ request, context }: Route.ActionArgs) {
headers
})
} catch {
return new Response(null, { status: 500 })
return new Response(null, { status: httpStatus.INTERNAL_SERVER })
}
}
@@ -68,7 +68,6 @@ export default function Index({}: Route.ComponentProps) {
const onSubmit = async (data: Schema) => {
await fetcher.submit(data, { method: 'post' })
console.log(fetcher.data)
}
return (