Improved samples for new capire

This commit is contained in:
Daniel Hutzel
2024-11-19 12:29:19 +01:00
parent 33b7691f51
commit 22709b8cdb
10 changed files with 48 additions and 42 deletions

View File

@@ -3,10 +3,10 @@ const cds = require('@sap/cds')
class CatalogService extends cds.ApplicationService { init() {
const { Books } = cds.entities('sap.capire.bookshop')
const { ListOfBooks } = this.entities
const { Books:Book } = this.entities
// Add some discount for overstocked books
this.after('each', ListOfBooks, book => {
this.after('each', Book, book => {
if (book.stock > 111) book.title += ` -- 11% discount!`
})