Skip to content

Leveraging consolidated srv returns#29

Draft
danjoa wants to merge 3 commits into
mainfrom
cds10
Draft

Leveraging consolidated srv returns#29
danjoa wants to merge 3 commits into
mainfrom
cds10

Conversation

@danjoa

@danjoa danjoa commented May 28, 2026

Copy link
Copy Markdown
Member
  • requires cds10 and upcomming @cap-js/sqlite

@danjoa danjoa marked this pull request as draft May 28, 2026 14:09
@danjoa danjoa requested review from johannes-vogel and sjvans May 28, 2026 14:09
Comment thread srv/cat-service.js Outdated
let {affected} = await UPDATE (Books,id)
.with `stock = stock - ${quantity}`
.where `stock >= ${quantity}`
if (!affected) req.error (409, `${quantity} exceeds stock for book #${id}`)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only the generic-crud handler of the app service does the exists check, doesn't it? The db service does not do that.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right → will change it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants