First push

This commit is contained in:
nkaputnik
2022-07-26 09:45:34 +02:00
parent 2b6d4c625e
commit c3c9dae80d
10 changed files with 203 additions and 69 deletions

View File

@@ -1,13 +1,13 @@
async function run() {
debugger
while (true) {}
process.exit()
//debugger
//while (true) {}
//process.exit()
//1.substring()
let res = await cds.read(SELECT.one`title`.from(`Books`).where(`ID=201`))
let { title } = res
const data = req.data
data.modifiedBy = "Custom Event handler read changed this!";
data.placeOfDeath = ' --- Somewhere over ' + title + ' --- create in Sandbox'
data.modifiedBy = "Custom Event handler read changed this!"
data.placeOfDeath = " --- Somewhere over " + title + " --- create in Sandbox"
return data
}
output = run()

View File

@@ -0,0 +1,5 @@
const result_ = Array.isArray(result) ? result : [result]
for (const row of result_) {
row.modifiedBy += " --- read in sandbox"
row.age = 27
}

View File

@@ -0,0 +1,9 @@
async function run() {
const {stock, price, author_ID} = req.data
if (stock<0) return req.reject('409', 'Stock must not be negative')
if (price<0) return req.reject('409', 'Price must not be negative')
let {name} = await SELECT.one`name`.from(`Authors`).where({ID: author_ID})
req.data.authorName=name
}
output = run()

View File

@@ -0,0 +1,6 @@
const result_ = Array.isArray(result) ? result : [result];
for (const row of result_) {
if (row.stock > 50) {
row.title += " ---Order now for a 10% discount!";
}
}