1
0
forked from apxtri/apxtri

fix bug in Odbmdb cud

This commit is contained in:
philc 2024-09-27 09:17:20 +02:00
parent 784bb6f6f3
commit 53d8a18536
2 changed files with 4 additions and 3 deletions

View File

@ -206,7 +206,7 @@ Checkjson.schema.data = (schema, data, withschemacheck) => {
// subdata={prop1,prop2}
// Return [] => no error, else 1 item per error {msg,ref:checkjson,data}
const propertielist = Object.keys(properties);
console.log(propertielist);
Object.keys(subdata).forEach((kdata) => {
if (!propertielist.includes(kdata)) {
delete subdata[kdata];

View File

@ -666,7 +666,8 @@ Odmdb.cud = (objectPathname, crud, itm, role, runindex = true) => {
//console.log("itm",itm)
//console.log(accessright)
accessright.U.forEach(async (p) => {
itmtostore[p] = itm[p];
// check this propertie exist in the requested update itm
if (itm[p] && itm[p] != "") itmtostore[p] = itm[p];
});
itmtostore.dt_update = dayjs().toISOString();
}
@ -712,7 +713,7 @@ Odmdb.cud = (objectPathname, crud, itm, role, runindex = true) => {
});
if (crud == "C") itmtostore.dt_create = dayjs().toISOString();
// check consistency of datatostore
console.log("itmstostore::::::", itmtostore);
//console.log("itmstostore::::::", itmtostore);
const chkdata = Checkjson.schema.data(
getschema.data.schema,
itmtostore,