Skip to content

Commit

Permalink
v0.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rjrodger committed May 24, 2021
1 parent 950bad0 commit 94625d4
Show file tree
Hide file tree
Showing 6 changed files with 327 additions and 280 deletions.
9 changes: 7 additions & 2 deletions dist/lib/make_cmd_save_history_msg.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/lib/make_cmd_save_history_msg.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 10 additions & 3 deletions lib/make_cmd_save_history_msg.ts
Expand Up @@ -38,8 +38,13 @@ export function make_cmd_save_history_msg(options: any) {
// let entprev = null == ent.id ? null : await ent.load$(ent.id)
let entprev = await ent.load$(ent.id)

let entout = await this.prior(msg, meta)
// Return this entity.
let orig_entout = await this.prior(msg, meta)

// Snapshot: use this to generate version.
let entout = orig_entout.clone$()


let changed: string[] = [] // changed fields

if (entprev) {
Expand Down Expand Up @@ -87,6 +92,7 @@ export function make_cmd_save_history_msg(options: any) {
what,
}


let wait = options.wait ||
(ent.history$ && ent.history$.wait) ||
(ent.custom$ && ent.custom$.history && ent.custom$.history.wait)
Expand All @@ -100,8 +106,9 @@ export function make_cmd_save_history_msg(options: any) {
}



return entout
// NOTE: return the original, which may be safely changed by calling code, since
// it is not used to create the version later (if not waiting).
return orig_entout

/*
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "@seneca/entity-history",
"version": "0.6.0",
"version": "0.7.0",
"description": "",
"main": "dist/entity-history.js",
"types": "dist/entity-history.d.ts",
Expand Down

0 comments on commit 94625d4

Please sign in to comment.