forked from apxtri/apxtri
fix bug in Odbmdb cud
This commit is contained in:
parent
784bb6f6f3
commit
53d8a18536
@ -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];
|
||||
|
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user