From d138c15dcd4272cd2358d28867ef35d1550b39cd Mon Sep 17 00:00:00 2001 From: HombreLaser Date: Mon, 15 May 2023 20:35:39 -0600 Subject: Mejora renderizado de formularios --- src/clients/loaders.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/clients/loaders.ts') diff --git a/src/clients/loaders.ts b/src/clients/loaders.ts index 8d0f06f..618e593 100644 --- a/src/clients/loaders.ts +++ b/src/clients/loaders.ts @@ -9,6 +9,17 @@ export async function loader({ request }) { return response; } +export async function addressLoader({ params }) { + const client = new ApiClient(); + const path = `/account/addresses/${params.addressId}`; + const request = await client.authenticatedGet(path); + + if(request.response) + return redirect("/account"); + + return request; +} + export async function accountLoader() { const client = new ApiClient(); -- cgit v1.2.3