17 lines
486 B
Plaintext
17 lines
486 B
Plaintext
change(number: Int, title: Text) (out: Int) {
|
|
created = model.create({ number = number, title = title, amount = number })
|
|
found = model.get(created.id)
|
|
updated = model.update(found.id, { amount = found.amount + 1 })
|
|
out = updated.amount
|
|
}
|
|
|
|
batch(numbers: List<Int>, title: Text) (checksum: Int, count: Int) {
|
|
removed = model.delete({ where = number >= 0 })
|
|
checksum = sum(each(change, numbers, title))
|
|
count = model.count()
|
|
}
|
|
|
|
count() (out: Int) {
|
|
out = model.count()
|
|
}
|