- Fixed: DB.storeNode not returning a Promise
This commit is contained in:
sairajzero 2023-07-08 13:20:22 +05:30
parent f585a76e64
commit 9468db3e1c

View File

@ -454,14 +454,16 @@ DB.storeTag = function (snID, data) {
}; };
DB.storeNote = function (snID, data) { DB.storeNote = function (snID, data) {
let attr = Object.keys(F_struct).map(a => F_struct[a]).concat(L_struct.LOG_TIME); return new Promise((resolve, reject) => {
let values = attr.map(a => data[a]).concat(data[H_struct.VECTOR_CLOCK]); let attr = Object.keys(F_struct).map(a => F_struct[a]).concat(L_struct.LOG_TIME);
let statement = "UPDATE _" + snID + let values = attr.map(a => data[a]).concat(data[H_struct.VECTOR_CLOCK]);
" SET " + attr.map(a => a + "=?").join(", ") + let statement = "UPDATE _" + snID +
" WHERE " + H_struct.VECTOR_CLOCK + "=?"; " SET " + attr.map(a => a + "=?").join(", ") +
queryResolve(statement, values) " WHERE " + H_struct.VECTOR_CLOCK + "=?";
.then(result => resolve(data)) queryResolve(statement, values)
.catch(error => reject(error)); .then(result => resolve(data))
.catch(error => reject(error));
})
} }
DB.deleteData = function (snID, vectorClock) { DB.deleteData = function (snID, vectorClock) {