Commit 3290b2ad authored by wilhelmhb's avatar wilhelmhb

débugage des paramètres généraux et des paramètres d'une ruche

parent 63106fac
......@@ -38,7 +38,7 @@ function goToGeneralParameters() {
$("#form-params-generaux").find(".bouton").click(function(e){$(this).off("click");
//console.log("début modif");
e.preventDefault();
var donnees = $(this).serialize();
var donnees = $(this).parent().serialize();
//console.log(donnees);
charge();
$.ajax({
......@@ -197,42 +197,48 @@ function goToHiveParameters() {
goToDataHive(true);
})
}
else {
$("#form-params-hive").find(".bouton").click(function(e){
$("#form-params-hive").submit();
});
$("#form-params-hive").submit(function(e){
//console.log("début modif");
e.preventDefault();
var donnees = $(this).serialize();
console.log(donnees);
console.log(donneesRuches.hivegroups[idHiveGroup].hives[idHive]);
charge();
$.ajax({
type: 'PATCH',
url: url+'pshive/'+donneesRuches.hivegroups[idHiveGroup].hives[idHive].id_hive + '/update',
xhrFields: {
withCredentials: true
},
data: donnees,
success: function(data) {
console.log(data);
//customer = data;
updateLocalHive(data);
console.log(donneesRuches.hivegroups[idHiveGroup].hives[idHive]);
/* go back to details */
finCharge();
goToDataHive(true);
//console.log("fin modif");
},
error: function (xhr, ajaxOptions, thrownError) {
console.log(xhr.responseText);
finCharge();
afficherBd("Une erreur est survenue","Fermer");
}
});
});
}
//organiserRuches(listHives.ruches.length);
//masquerBd();
//console.log('goToHiveParameters : end');
}
function submitParamsHive(){
console.log("début modif");
var donnees = $(this).serialize();
console.log(donnees);
console.log(donneesRuches.hivegroups[idHiveGroup].hives[idHive]);
charge();
$.ajax({
type: 'PATCH',
url: url+'pshive/'+donneesRuches.hivegroups[idHiveGroup].hives[idHive].id_hive + '/update',
xhrFields: {
withCredentials: true
},
data: donnees,
success: function(data) {
console.log(data);
//customer = data;
updateLocalHive(data);
console.log(donneesRuches.hivegroups[idHiveGroup].hives[idHive]);
/* go back to details */
finCharge();
goToDataHive(true);
//console.log("fin modif");
},
error: function (xhr, ajaxOptions, thrownError) {
console.log(xhr.responseText);
finCharge();
afficherBd("Une erreur est survenue","Fermer");
}
});
}
/**
* display the parameters for the floor and ceiling value (launching the notifications)
*/
......
......@@ -232,7 +232,7 @@
<div class="bouton"><span>MODIFIER</span></div>
<br />
<div id="deconnexion" class="bouton2" style="text-align:center;clear:none;" >Me déconnecter</div>
<div id="desinscription" class="bouton2" style="text-align:center;clear:none;background-color:black;color:white;">Me desinscrire</div>
<div id="desinscription" class="bouton2" style="text-align:center;clear:none;background-color:black;color:white;">Me désinscrire</div>
</form>
</script>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment