From f308ab80c924941a66a510df36631afb3013b32d Mon Sep 17 00:00:00 2001 From: Wroclaw Date: Wed, 20 Dec 2023 05:06:38 +0100 Subject: [PATCH] Use one format for slashes prepend/append where fetch is used always prepend slash never append slash --- pages/clients.vue | 4 ++-- pages/orders.vue | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pages/clients.vue b/pages/clients.vue index 743158a..a4e40b3 100644 --- a/pages/clients.vue +++ b/pages/clients.vue @@ -32,7 +32,7 @@ async function rowClicked(client: string, edit = false) { async function rowDelete(client: string) { try { - await $fetch(`/api/clients/${client}` as "api/clients/:id", { + await $fetch(`/api/clients/${client}` as "/api/clients/:id", { method: "DELETE", }); clients.value = clients.value.filter(e => e.id !== client); @@ -92,7 +92,7 @@ async function handleSubmit() { normalizeForm(); try { const result = await $fetch( - "/api/clients/", { + "/api/clients", { method: "POST", body: formData.value, }, diff --git a/pages/orders.vue b/pages/orders.vue index b583479..c255fba 100644 --- a/pages/orders.vue +++ b/pages/orders.vue @@ -33,7 +33,7 @@ async function rowClicked(client: string, edit = false) { async function rowDelete(client: string) { try { - await $fetch(`/api/orders/${client}` as "api/orders/:id", { + await $fetch(`/api/orders/${client}` as "/api/orders/:id", { method: "DELETE", }); orders.value = orders.value.filter(e => e.id !== client);