mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-12 19:30:52 +00:00
Fix private txes (#2544)
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
parent
aebb215799
commit
0a5a753299
@ -73,9 +73,9 @@ class TPipeline implements Pipeline {
|
||||
}
|
||||
|
||||
async tx (ctx: SessionContext, tx: Tx): Promise<[TxResult, Tx[], string | undefined]> {
|
||||
const [session, resTx] = this.head === undefined ? [ctx, tx] : await this.head.tx(ctx, tx)
|
||||
const [session, resTx, target] = this.head === undefined ? [ctx, tx] : await this.head.tx(ctx, tx)
|
||||
const res = await this.storage.tx(session, resTx)
|
||||
return [...res, undefined]
|
||||
return [res[0], res[1], target]
|
||||
}
|
||||
|
||||
async close (): Promise<void> {
|
||||
|
@ -46,7 +46,6 @@ export class ConfigurationMiddleware extends BaseMiddleware implements Middlewar
|
||||
}
|
||||
|
||||
async tx (ctx: SessionContext, tx: Tx): Promise<TxMiddlewareResult> {
|
||||
let target: string | undefined
|
||||
if (this.storage.hierarchy.isDerived(tx._class, core.class.TxCUD)) {
|
||||
const txCUD = tx as TxCUD<Doc>
|
||||
const domain = this.storage.hierarchy.getDomain(txCUD.objectClass)
|
||||
@ -59,8 +58,7 @@ export class ConfigurationMiddleware extends BaseMiddleware implements Middlewar
|
||||
}
|
||||
}
|
||||
}
|
||||
const res = await this.provideTx(ctx, tx)
|
||||
return [res[0], res[1], res[2] ?? target]
|
||||
return await this.provideTx(ctx, tx)
|
||||
}
|
||||
|
||||
override async findAll<T extends Doc>(
|
||||
|
@ -41,7 +41,6 @@ export class ModifiedMiddleware extends BaseMiddleware implements Middleware {
|
||||
const coltx = tx as TxCollectionCUD<Doc, AttachedDoc>
|
||||
coltx.tx.modifiedOn = tx.modifiedOn
|
||||
}
|
||||
const res = await this.provideTx(ctx, tx)
|
||||
return [res[0], res[1], res[2]]
|
||||
return await this.provideTx(ctx, tx)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user