mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-13 19:58:09 +00:00
Fix integration notification (#3213)
This commit is contained in:
parent
074fa7dbc4
commit
e529248795
@ -74,7 +74,7 @@ async function fillMigrationCollaborator (tx: TxOperations): Promise<void> {
|
||||
if (h.hasMixin(value, notification.mixin.Collaborators)) {
|
||||
const collabs = h.as<Doc, Collaborators>(value, notification.mixin.Collaborators)
|
||||
if (collabs.collaborators === undefined || !collabs.collaborators.includes(collabs.modifiedBy)) {
|
||||
await tx.updateMixin<Doc, Collaborators>(
|
||||
const res = tx.txFactory.createTxMixin<Doc, Collaborators>(
|
||||
value._id,
|
||||
value._class,
|
||||
value.space,
|
||||
@ -83,9 +83,11 @@ async function fillMigrationCollaborator (tx: TxOperations): Promise<void> {
|
||||
collaborators: [collabs.createdBy ?? collabs.modifiedBy]
|
||||
}
|
||||
)
|
||||
res.space = core.space.DerivedTx
|
||||
await tx.tx(res)
|
||||
}
|
||||
} else {
|
||||
await tx.createMixin<Doc, Collaborators>(
|
||||
const res = tx.txFactory.createTxMixin<Doc, Collaborators>(
|
||||
value._id,
|
||||
setting.class.Integration,
|
||||
value.space,
|
||||
@ -94,6 +96,8 @@ async function fillMigrationCollaborator (tx: TxOperations): Promise<void> {
|
||||
collaborators: [value.createdBy ?? value.modifiedBy]
|
||||
}
|
||||
)
|
||||
res.space = core.space.DerivedTx
|
||||
await tx.tx(res)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -333,7 +333,7 @@ export async function OnChannelUpdate (tx: Tx, control: TriggerControl): Promise
|
||||
)
|
||||
}
|
||||
} else {
|
||||
control.txFactory.createTxMixin<Doc, Collaborators>(
|
||||
const res = control.txFactory.createTxMixin<Doc, Collaborators>(
|
||||
doc._id,
|
||||
doc._class,
|
||||
doc.space,
|
||||
@ -342,7 +342,7 @@ export async function OnChannelUpdate (tx: Tx, control: TriggerControl): Promise
|
||||
collaborators: [tx.modifiedBy]
|
||||
}
|
||||
)
|
||||
result.push()
|
||||
result.push(res)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user