From 82c633ce016b370e7cb905026a4df4c08a809d6e Mon Sep 17 00:00:00 2001 From: Daniel Hutzel Date: Mon, 15 Jul 2024 14:45:03 +0200 Subject: [PATCH] Post TechEd cosmetics (#619) * Post TechEd cosmetics * Update package-lock.json --- bookshop/db/init.js | 4 ++-- bookshop/index.js | 2 -- bookshop/srv/cat-service.js | 5 ++++- package.json | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 bookshop/index.js diff --git a/bookshop/db/init.js b/bookshop/db/init.js index 6295808d..77a50c0f 100644 --- a/bookshop/db/init.js +++ b/bookshop/db/init.js @@ -8,7 +8,7 @@ const cds = require('@sap/cds') // NOTE: We use cds.on('served') to delay the UPSERTs after the db init // to run after all INSERTs from .csv files happened. -module.exports = cds.on('served', ()=> cds.run( +module.exports = cds.on('served', ()=> UPSERT.into ('sap.common.Currencies') .columns ( [ 'code', 'symbol', 'name' ] ) .rows ( @@ -18,4 +18,4 @@ module.exports = cds.on('served', ()=> cds.run( [ 'ILS', '₪', 'Shekel' ], [ 'JPY', '¥', 'Yen' ], ) -)) +) diff --git a/bookshop/index.js b/bookshop/index.js deleted file mode 100644 index 7bffbe36..00000000 --- a/bookshop/index.js +++ /dev/null @@ -1,2 +0,0 @@ -const { CatalogService } = require('./srv/cat-service') -module.exports = { CatalogService } diff --git a/bookshop/srv/cat-service.js b/bookshop/srv/cat-service.js index 0521c7ab..40896f4b 100644 --- a/bookshop/srv/cat-service.js +++ b/bookshop/srv/cat-service.js @@ -1,5 +1,6 @@ const cds = require('@sap/cds') -module.exports = class CatalogService extends cds.ApplicationService { init() { + +class CatalogService extends cds.ApplicationService { init() { const { Books } = cds.entities('sap.capire.bookshop') const { ListOfBooks } = this.entities @@ -33,3 +34,5 @@ module.exports = class CatalogService extends cds.ApplicationService { init() { // Delegate requests to the underlying generic service return super.init() }} + +module.exports = CatalogService diff --git a/package.json b/package.json index 502dcaab..3e322243 100644 --- a/package.json +++ b/package.json @@ -47,4 +47,4 @@ }, "license": "SEE LICENSE IN LICENSE", "private": true - } \ No newline at end of file + }