it works
This commit is contained in:
@@ -18,8 +18,7 @@
|
||||
"API_BUSINESS_PARTNER": {
|
||||
"kind": "odata",
|
||||
"model": "srv/external/API_BUSINESS_PARTNER",
|
||||
"--credentials": {
|
||||
}
|
||||
"credentials": { "destination": "cap-api532" }
|
||||
},
|
||||
"messaging": {
|
||||
"kind": "enterprise-messaging"
|
||||
@@ -30,9 +29,7 @@
|
||||
"strategy": "mock",
|
||||
"users": {
|
||||
"alice": {
|
||||
"roles": [
|
||||
"admin"
|
||||
],
|
||||
"roles": ["admin"],
|
||||
"password": "secret",
|
||||
"ID": "ALICE"
|
||||
}
|
||||
@@ -40,4 +37,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,21 +20,20 @@ const _qlsToUpdateDifferences = (ownAddresses, remoteAddresses) =>
|
||||
)
|
||||
if (remoteAddress) {
|
||||
const diff = _diff(ownAddress, remoteAddress)
|
||||
return (
|
||||
Object.keys(diff).length &&
|
||||
console.log('changing', diff) &&
|
||||
UPDATE(ShippingAddresses)
|
||||
if(Object.keys(diff).length) {
|
||||
console.log('changing', diff)
|
||||
return UPDATE(ShippingAddresses)
|
||||
.set(diff)
|
||||
.where({
|
||||
BusinessPartner: ownAddress.BusinessPartner,
|
||||
AddressID: ownAddress.AddressID
|
||||
})
|
||||
)
|
||||
}
|
||||
}
|
||||
})
|
||||
.filter(el => el)
|
||||
|
||||
bupaSrv.on('sap/messaging/ccf/BO/BusinessPartner/Changed', async msg => {
|
||||
bupaSrv.on('sap/S4HANAOD/c532/BO/BusinessPartner/Changed', async msg => {
|
||||
console.log('>> Message:', msg.data)
|
||||
|
||||
const BusinessPartner = msg.data.KEY[0].BUSINESSPARTNER
|
||||
|
||||
@@ -6,7 +6,7 @@ module.exports = srv => {
|
||||
KEY: [{ BUSINESSPARTNER: req.data.BusinessPartner }]
|
||||
}
|
||||
console.log('<< Message:', payload)
|
||||
srv.emit('sap/messaging/ccf/BO/BusinessPartner/Changed', payload)
|
||||
srv.emit('sap/S4HANAOD/c532/BO/BusinessPartner/Changed', payload)
|
||||
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user