This commit is contained in:
Denis Bykhov 2022-05-04 16:23:53 +06:00 committed by GitHub
parent 8d7e3078e1
commit 916a8203cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -48,7 +48,7 @@ const extractTx = (tx: Tx): Tx => {
create.attributes.collection = ctx.collection
return create
}
return ctx
return ctx.tx
}
return tx
@ -136,7 +136,7 @@ export async function UpdateLastView (tx: Tx, control: TriggerControl): Promise<
case core.class.TxMixin: {
const tx = actualTx as TxCUD<Doc>
const doc = (await control.findAll(tx.objectClass, { _id: tx.objectId }, { limit: 1 }))[0]
if (doc !== undefined && !control.hierarchy.isDerived(doc._class, core.class.AttachedDoc)) {
if (doc !== undefined) {
const resTx = await getUpdateLastViewTx(control.findAll, doc._id, doc._class, tx.modifiedOn, tx.modifiedBy)
if (resTx !== undefined) {
result.push(resTx)