thatcher 1.0.36 → 1.0.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +8 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thatcher",
3
- "version": "1.0.36",
3
+ "version": "1.0.37",
4
4
  "description": "A config-driven application framework for building data-intensive web apps without code.",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
package/src/index.js CHANGED
@@ -284,9 +284,15 @@ export class Thatcher {
284
284
  return create(entity, data, user);
285
285
  }
286
286
 
287
- async update(entity, id, data, user) {
287
+ // opts.expectedVersion: optional optimistic-concurrency guard (see
288
+ // busybase-store.js update()) -- a caller that read the row's _version can
289
+ // pass it here to detect (via a thrown {code:'conflict'} error) a concurrent
290
+ // writer landing in between, instead of silently clobbering it. `user` stays
291
+ // its own positional param (unused by the store today, kept for API
292
+ // stability with existing callers); opts is a new, optional 5th param.
293
+ async update(entity, id, data, user, opts = {}) {
288
294
  const { update } = await import(resolveModule('./lib/busybase-store.js'));
289
- return update(entity, id, data, user);
295
+ return update(entity, id, data, opts);
290
296
  }
291
297
 
292
298
  async delete(entity, id) {