refactoring requests

This commit is contained in:
Dzmitry_Tamashevich@epam.com
2020-11-05 00:19:23 +03:00
committed by Daniel Hutzel
parent 70b0c85346
commit 34acef85b6
6 changed files with 7 additions and 25 deletions

View File

@@ -16,12 +16,6 @@ module.exports = async function () {
const db = await cds.connect.to("db"); // connect to database service
const { Invoices, InvoiceItems } = db.entities;
// this.before("*", (req) => {
// if (!req.user.is("customer")) {
// req.reject(403);
// }
// });
this.on("READ", "Invoices", async (req) => {
return await db.run(req.query.where({ customer_ID: req.user.attr.ID }));
});