summaryrefslogtreecommitdiff
path: root/src/clients/actions.ts
diff options
context:
space:
mode:
authorHombreLaser <sebastian-440@live.com>2023-05-22 21:18:20 -0600
committerHombreLaser <sebastian-440@live.com>2023-05-22 21:18:20 -0600
commit21508a3514500f8f38ddaa8bef7a9cd420d76628 (patch)
treee416d58752154f7cbe78a96c1fbe35dd34a8703f /src/clients/actions.ts
parentb5885b23a8d3593428334683b8c03075ce071f3a (diff)
Añade carrito
Diffstat (limited to 'src/clients/actions.ts')
-rw-r--r--src/clients/actions.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/clients/actions.ts b/src/clients/actions.ts
index acc5ad3..cee9a85 100644
--- a/src/clients/actions.ts
+++ b/src/clients/actions.ts
@@ -56,13 +56,15 @@ export async function authenticatedEdit({ request }) {
}
}
-export async function createAddress({ request }) {
+export async function create({ request }) {
clearSessionStorage();
const client = new ApiClient();
+ const paths = new URL(request.url).pathname.split('/');
+ const request_path = paths.slice(0, paths.length - 1).join('/');
const form_data = await request.formData();
try{
- await client.post('/account/addresses', form_data, client.authorizationHeaders());
+ await client.post(request_path, form_data, client.authorizationHeaders());
return redirect("/account");
} catch(error) {