mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-14 04:08:19 +00:00
UBERF-4478: set modifiedOn on server for collections tx (#4103)
Signed-off-by: Vyacheslav Tumanov <me@slavatumanov.me>
This commit is contained in:
parent
89baa98767
commit
dfbf8eb33d
@ -13,7 +13,7 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
import core, { MeasureContext, ServerStorage, Tx, systemAccountEmail } from '@hcengineering/core'
|
||||
import core, { MeasureContext, ServerStorage, Tx, systemAccountEmail, TxCollectionCUD } from '@hcengineering/core'
|
||||
import { BroadcastFunc, Middleware, SessionContext, TxMiddlewareResult } from '@hcengineering/server-core'
|
||||
import { BaseMiddleware } from './base'
|
||||
|
||||
@ -38,6 +38,9 @@ export class ModifiedMiddleware extends BaseMiddleware implements Middleware {
|
||||
if (tx.modifiedBy !== core.account.System && ctx.userEmail !== systemAccountEmail) {
|
||||
tx.modifiedOn = Date.now()
|
||||
tx.createdOn = tx.createdOn ?? tx.modifiedOn
|
||||
if (tx._class === core.class.TxCollectionCUD) {
|
||||
;(tx as TxCollectionCUD<any, any>).tx.modifiedOn = Date.now()
|
||||
}
|
||||
}
|
||||
return await this.provideTx(ctx, tx)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user