Update services.js

This commit is contained in:
Dr. David Kunz
2020-02-12 17:13:35 +01:00
committed by GitHub
parent 13480ad99e
commit e2b47228db

View File

@@ -22,7 +22,7 @@ module.exports['sap.capire.bookstore.CatalogService'] = cds.service.impl (async
ReviewsService.on ('reviewed', (msg) => { ReviewsService.on ('reviewed', (msg) => {
console.debug ('> received message:', msg.event, msg.data) console.debug ('> received message:', msg.event, msg.data)
const {subject,rating} = msg.data const {subject,rating} = msg.data
const tx = cds // cds.transaction(msg) // TODO: how to add multi-tenancy? const tx = cds.transaction(msg)
return tx.run (UPDATE(Books).set({rating}) .where ({ID:subject})) //.then (console.log) return tx.run (UPDATE(Books).set({rating}) .where ({ID:subject})) //.then (console.log)
}) })