Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions db/init.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const cds = require('@sap/cds')
import cds from '@sap/cds'

/**
* In order to keep basic bookshop sample as simple as possible, we don't add
Expand All @@ -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.on('served', ()=>
UPSERT.into ('sap.common.Currencies') .columns (
[ 'code', 'symbol', 'name' ]
) .rows (
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "2.1.11",
"description": "Our primer sample for getting started in a nutshell.",
"repository": "https://github.com/capire/bookshop",
"type": "module",
"files": [
"app",
"srv",
Expand Down
4 changes: 2 additions & 2 deletions srv/admin-service.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const cds = require('@sap/cds')
import cds from '@sap/cds'

module.exports = class AdminService extends cds.ApplicationService { init(){
export class AdminService extends cds.ApplicationService { init(){
this.before (['NEW','CREATE'],'Authors', genid)
this.before (['NEW','CREATE'],'Books', genid)
return super.init()
Expand Down
6 changes: 2 additions & 4 deletions srv/cat-service.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const cds = require('@sap/cds')
import cds from '@sap/cds'

class CatalogService extends cds.ApplicationService { init() {
export class CatalogService extends cds.ApplicationService { init() {

const { Books } = cds.entities ('sap.capire.bookshop')
const { ListOfBooks } = this.entities
Expand All @@ -25,5 +25,3 @@ class CatalogService extends cds.ApplicationService { init() {
// Delegate requests to the underlying generic service
return super.init()
}}

module.exports = CatalogService