file-based not needed

This commit is contained in:
D065023
2020-01-29 08:34:49 +01:00
parent 29840afc0b
commit 9b41615ac8
3 changed files with 4 additions and 8 deletions

View File

@@ -21,9 +21,6 @@
"--credentials": {
"destination": "cap-api098"
}
},
"messaging": {
"kind": "file-based-messaging"
}
}
}

View File

@@ -18,9 +18,9 @@ service CatalogService {
Country
};
event ContactDetailsChanged {
event OrdersOutdated {
orders: array of my.Orders
}
};
@requires_: 'authenticated-user'
@insertonly entity Orders as projection on my.Orders;

View File

@@ -11,9 +11,8 @@ module.exports = cds.service.impl(async function () {
console.log('>> Received message', msg.data)
const BUSINESSPARTNER = msg.data.KEY[0].BUSINESSPARTNER
const orders = await cds.tx(msg).run(SELECT.from(Orders).where({ createdBy: BUSINESSPARTNER }))
const payload = { orders }
this.emit('ContactDetailsChanged', payload)
console.log('<< Emitting message', payload)
this.emit('OrdersOutdated', { orders })
console.log('<< Emitting message', { orders })
})
/** Add some discount for overstocked books */