trim spaces from short_name, otherwise recipes become unnavigatable if ending on spaces
All checks were successful
CI / update (push) Successful in 7s

This commit is contained in:
Alexander Bocken 2024-08-18 21:20:03 +02:00
parent 176ffae32c
commit 1dd47824c7
Signed by: Alexander
GPG Key ID: 1D237BE83F9B05E8
2 changed files with 5 additions and 5 deletions

View File

@ -110,7 +110,7 @@
...add_info,
images: {mediapath: short_name + '.webp', alt: "", caption: ""}, // TODO
season: season_local,
short_name,
short_name : short_name.trim(),
portions: portions_local,
datecreated,
datemodified,

View File

@ -160,7 +160,7 @@
async function upload_img(){
const data = {
image: img_local,
name: short_name,
name: short_name.trim(),
}
const res = await fetch(`/api/rezepte/img/add`, {
method: 'POST',
@ -191,7 +191,7 @@
},
body: JSON.stringify({
old_name: old_short_name,
new_name: short_name,
new_name: short_name.trim(),
})
})
if(!res_img.ok){
@ -208,7 +208,7 @@
...add_info,
images, // TODO
season: season_local,
short_name,
short_name short_name.trim(),
datecreated,
portions: portions_local,
datemodified,
@ -228,7 +228,7 @@
if(res.ok){
const url = location.href.split('/');
url.splice(url.length -2, 2);
url.push(short_name);
url.push(short_name.trim());
location.assign(url.join('/'))
}
else{