Compare commits
3 Commits
mocha
...
trying-esm
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
518429e2a0 | ||
|
|
02000f4a94 | ||
|
|
9370d0544e |
@@ -4,7 +4,7 @@
|
|||||||
* currencies, if not obtained through @capire/common.
|
* currencies, if not obtained through @capire/common.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
module.exports = async (db)=>{
|
export default async (db)=>{
|
||||||
|
|
||||||
const has_common = db.model.definitions['sap.common.Currencies'].elements.numcode
|
const has_common = db.model.definitions['sap.common.Currencies'].elements.numcode
|
||||||
if (has_common) return
|
if (has_common) return
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
const { CatalogService } = require('./srv/cat-service')
|
import { CatalogService } from './srv/cat-service.js'
|
||||||
module.exports = { CatalogService }
|
export { CatalogService }
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
"name": "@capire/bookshop",
|
"name": "@capire/bookshop",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "A simple self-contained bookshop service.",
|
"description": "A simple self-contained bookshop service.",
|
||||||
|
"type": "module",
|
||||||
"files": [
|
"files": [
|
||||||
"app",
|
"app",
|
||||||
"srv",
|
"srv",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
const cds = require('@sap/cds')
|
import cds from '@sap/cds'
|
||||||
|
|
||||||
module.exports = cds.service.impl (function(){
|
export default cds.service.impl (function(){
|
||||||
this.before ('NEW','Authors', genid)
|
this.before ('NEW','Authors', genid)
|
||||||
this.before ('NEW','Books', genid)
|
this.before ('NEW','Books', genid)
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -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 } = this.entities ('sap.capire.bookshop')
|
const { Books } = this.entities ('sap.capire.bookshop')
|
||||||
|
|
||||||
@@ -24,5 +24,3 @@ class CatalogService extends cds.ApplicationService { init(){
|
|||||||
|
|
||||||
return super.init()
|
return super.init()
|
||||||
}}
|
}}
|
||||||
|
|
||||||
module.exports = { CatalogService }
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
const cds = require('@sap/cds')
|
import cds from '@sap/cds'
|
||||||
module.exports = class UserService extends cds.Service { init(){
|
|
||||||
|
export default class UserService extends cds.Service { init(){
|
||||||
this.on('READ', 'me', ({ tenant, user, locale }) => ({ id: user.id, locale, tenant }))
|
this.on('READ', 'me', ({ tenant, user, locale }) => ({ id: user.id, locale, tenant }))
|
||||||
this.on('login', (req) => {
|
this.on('login', (req) => {
|
||||||
if (req.user._is_anonymous)
|
if (req.user._is_anonymous)
|
||||||
|
|||||||
Reference in New Issue
Block a user