fixed a bug

This commit is contained in:
D065023
2019-12-11 16:37:51 +01:00
parent 348a7b191e
commit b298c9b708
6 changed files with 84 additions and 79 deletions

View File

@@ -54,11 +54,13 @@ bupaSrv.on('sap/messaging/ccf/BO/BusinessPartner/Changed', async msg => {
try {
const remoteAddresses = await txExt.run(selectQl)
const qlsToUpdateDifferences = _qlsToUpdateDifferences(ownAddresses, remoteAddresses)
const tx2 = cds.transaction()
await Promise.all(qlsToUpdateDifferences.map(ql =>
tx2.run(ql)
))
tx2.commit()
if (qlsToUpdateDifferences.length) {
const tx2 = cds.transaction()
await Promise.all(qlsToUpdateDifferences.map(ql =>
tx2.run(ql)
))
tx2.commit()
}
} catch (e) {
console.error(e)
}