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.
- package/package.json +1 -1
- package/src/index.js +8 -2
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -284,9 +284,15 @@ export class Thatcher {
|
|
|
284
284
|
return create(entity, data, user);
|
|
285
285
|
}
|
|
286
286
|
|
|
287
|
-
|
|
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,
|
|
295
|
+
return update(entity, id, data, opts);
|
|
290
296
|
}
|
|
291
297
|
|
|
292
298
|
async delete(entity, id) {
|