mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-14 04:08:19 +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]> {
|
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)
|
const res = await this.storage.tx(session, resTx)
|
||||||
return [...res, undefined]
|
return [res[0], res[1], target]
|
||||||
}
|
}
|
||||||
|
|
||||||
async close (): Promise<void> {
|
async close (): Promise<void> {
|
||||||
|
@ -46,7 +46,6 @@ export class ConfigurationMiddleware extends BaseMiddleware implements Middlewar
|
|||||||
}
|
}
|
||||||
|
|
||||||
async tx (ctx: SessionContext, tx: Tx): Promise<TxMiddlewareResult> {
|
async tx (ctx: SessionContext, tx: Tx): Promise<TxMiddlewareResult> {
|
||||||
let target: string | undefined
|
|
||||||
if (this.storage.hierarchy.isDerived(tx._class, core.class.TxCUD)) {
|
if (this.storage.hierarchy.isDerived(tx._class, core.class.TxCUD)) {
|
||||||
const txCUD = tx as TxCUD<Doc>
|
const txCUD = tx as TxCUD<Doc>
|
||||||
const domain = this.storage.hierarchy.getDomain(txCUD.objectClass)
|
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 await this.provideTx(ctx, tx)
|
||||||
return [res[0], res[1], res[2] ?? target]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override async findAll<T extends Doc>(
|
override async findAll<T extends Doc>(
|
||||||
|
@ -41,7 +41,6 @@ export class ModifiedMiddleware extends BaseMiddleware implements Middleware {
|
|||||||
const coltx = tx as TxCollectionCUD<Doc, AttachedDoc>
|
const coltx = tx as TxCollectionCUD<Doc, AttachedDoc>
|
||||||
coltx.tx.modifiedOn = tx.modifiedOn
|
coltx.tx.modifiedOn = tx.modifiedOn
|
||||||
}
|
}
|
||||||
const res = await this.provideTx(ctx, tx)
|
return await this.provideTx(ctx, tx)
|
||||||
return [res[0], res[1], res[2]]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user