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