refactor import usage. refactor invoices implementation

This commit is contained in:
Dzmitry_Tamashevich@epam.com
2020-11-03 12:22:02 +03:00
committed by Daniel Hutzel
parent bcfce87276
commit 3cf02cb567
9 changed files with 91 additions and 88 deletions

View File

@@ -1,4 +1,5 @@
const cds = require("@sap/cds");
const { importData } = require("./util/importData");
// handle bootstrapping events...
cds.on("bootstrap", (app) => {
// dev only
@@ -24,7 +25,8 @@ cds.on("bootstrap", (app) => {
});
// add your own middleware before any by cds are added
});
cds.on("served", () => {
cds.on("served", async ({ db }) => {
await importData(db);
// add more middleware after all CDS servies
});
// delegate to default server.js: