Merge branch 'master' into cds.context

This commit is contained in:
Daniel
2020-12-17 16:41:08 +01:00
7 changed files with 13 additions and 8 deletions

View File

@@ -16,7 +16,7 @@ class OrdersService extends cds.ApplicationService {
this.before ('DELETE', 'Orders', async function(req) {
const { ID } = req.data
const Items = await SELECT.from (OrderItems, oi => { oi.product_ID, oi.amount }) .where ({up__ID:ID})
if (Items) for (let it of Items) this.orderChanged (it.product_ID, -it.amount)
if (Items) await Promise.all (Items.map(it => this.orderChanged (it.product_ID, -it.amount)))
})
return super.init()