admin update

This commit is contained in:
2025-08-01 09:38:00 +02:00
parent 19387bcac8
commit 8965547896
16 changed files with 2706 additions and 507 deletions

View File

@@ -196,7 +196,7 @@ apx.listendatawco = (newpropertie) => {
if (!apx.wco) apx.wco = {};
console.log(
"wco dynamic into the webpage",
apx.wco,
apx.data.wco,
"no propertie to add:",
!newpropertie
);
@@ -217,13 +217,19 @@ apx.listendatawco = (newpropertie) => {
const elements = document.querySelectorAll(`[data-wco='${p}']`);
elements.forEach((e) => actionprop(apx.data.wco[p], e));
//console.log(p, Object.hasOwnProperty(apx.wco));
if (Object.hasOwnProperty(apx.wco)) {
Object.defineProperty(apx.wco, p, {
if (!apx.data.wco.hasOwnProperty(p)) {
let _val = apx.data.wco[p]; // Stocke la valeur initiale
Object.defineProperty(apx.data.wco, p, {
get: () => _val,
set: (newv) => {
this[p] = newv;
_val = newv; // Met à jour la valeur interne
const elements = document.querySelectorAll(`[data-wco='${p}']`); // Re-sélectionne les éléments au cas où le DOM aurait changé
elements.forEach((e) => actionprop(newv, e));
},
});
if (_val !== undefined) {
apx.data.wco[p] = _val;
}
}
});
};
@@ -491,7 +497,7 @@ apx.update = async () => {
console.log("WARNING!!, local apxtri.wco was erase by updatelocaldb.wco");
}*/
Object.keys(initset.data.data).forEach((k) => {
if (k != "headers") {
if (k !== "headers") {
apx.data[k] = initset.data.data[k];
}
});