{data.description}
+ {/if} {#if data.preamble}{data.preamble}
{/if} diff --git a/src/routes/rezepte/add/+page.svelte b/src/routes/rezepte/add/+page.svelte index ea6dfc8..1d3394f 100644 --- a/src/routes/rezepte/add/+page.svelte +++ b/src/routes/rezepte/add/+page.svelte @@ -126,7 +126,17 @@ bearer: password, } }) - }) + }); + if(res.status === 200){ + const url = location.href.split('/') + url.splice(url.length -1, 1); + url.push(short_name) + location.assign(url.join('/')) + } + else{ + const item = await res.json(); + alert(item.message) + } } diff --git a/src/routes/rezepte/edit/[name]/+page.svelte b/src/routes/rezepte/edit/[name]/+page.svelte index 01744a1..839186d 100644 --- a/src/routes/rezepte/edit/[name]/+page.svelte +++ b/src/routes/rezepte/edit/[name]/+page.svelte @@ -98,6 +98,15 @@ }) }) + if(res.status === 200){ + const url = location.href.split('/') + url.splice(url.length -2, 2); + location.assign(url.join('/')) + } + else{ + const item = await res.json(); + alert(item.message) + } } async function doEdit() { const res = await fetch('/api/edit', { @@ -124,7 +133,15 @@ } }) }) - const item = await res.json(); + if(res.status === 200){ + const url = location.href.split('/'); + url.splice(url.length -2, 1); + location.assign(url.join('/')) + } + else{ + const item = await res.json() + alert(item.message) + } } diff --git a/src/routes/test/+page.svelte_ b/src/routes/test/+page.svelte_ new file mode 100644 index 0000000..e8d5be9 --- /dev/null +++ b/src/routes/test/+page.svelte_ @@ -0,0 +1,249 @@ + + + + + +