Use one format for slashes prepend/append where fetch is used

always prepend slash
never append slash
This commit is contained in:
Wroclaw 2023-12-20 05:06:38 +01:00
parent 8bfc059b66
commit f308ab80c9
2 changed files with 3 additions and 3 deletions

View file

@ -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,
},

View file

@ -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);