refactoring requests
This commit is contained in:
committed by
Daniel Hutzel
parent
70b0c85346
commit
34acef85b6
@@ -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 }));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user