Ready for prod.

This commit is contained in:
2026-04-09 18:14:09 +02:00
parent 0ae685753f
commit f933065275
13 changed files with 84 additions and 19 deletions

View File

@@ -40,7 +40,7 @@ document.addEventListener("DOMContentLoaded", function(){
if (data.success) {
let new_elem = document.createElement("option");
new_elem.setAttribute("value",document.getElementById('recette-form-ingr-nom').value);
new_elem.setAttribute("value",data.id);
new_elem.innerText = document.getElementById('recette-form-ingr-nom').value;
cible.appendChild(new_elem);
@@ -86,7 +86,7 @@ document.addEventListener("DOMContentLoaded", function(){
if (data.success) {
let new_elem = document.createElement("option");
new_elem.setAttribute("value",nomTag.value);
new_elem.setAttribute("value",data.id);
new_elem.innerText = nomTag.value;
cible.appendChild(new_elem);
@@ -146,7 +146,11 @@ document.addEventListener("DOMContentLoaded", function(){
else {
reponse.json().then( data => {
if (data.success) {
alert( "Envoyé" );
if( IS_EDIT )
alert( "Votre recette a été ajouté, vous allez être redirigé." );
else
alert( "Votre recette a été ajouté, vous allez être redirigé." );
window.location.href = data.route !== null ? data.route : window.location.origin;
} else {
alert( data.error || "" );
}