mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-22 00:10:37 +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)) {
|
if (h.hasMixin(value, notification.mixin.Collaborators)) {
|
||||||
const collabs = h.as<Doc, Collaborators>(value, notification.mixin.Collaborators)
|
const collabs = h.as<Doc, Collaborators>(value, notification.mixin.Collaborators)
|
||||||
if (collabs.collaborators === undefined || !collabs.collaborators.includes(collabs.modifiedBy)) {
|
if (collabs.collaborators === undefined || !collabs.collaborators.includes(collabs.modifiedBy)) {
|
||||||
await tx.updateMixin<Doc, Collaborators>(
|
const res = tx.txFactory.createTxMixin<Doc, Collaborators>(
|
||||||
value._id,
|
value._id,
|
||||||
value._class,
|
value._class,
|
||||||
value.space,
|
value.space,
|
||||||
@ -83,9 +83,11 @@ async function fillMigrationCollaborator (tx: TxOperations): Promise<void> {
|
|||||||
collaborators: [collabs.createdBy ?? collabs.modifiedBy]
|
collaborators: [collabs.createdBy ?? collabs.modifiedBy]
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
res.space = core.space.DerivedTx
|
||||||
|
await tx.tx(res)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
await tx.createMixin<Doc, Collaborators>(
|
const res = tx.txFactory.createTxMixin<Doc, Collaborators>(
|
||||||
value._id,
|
value._id,
|
||||||
setting.class.Integration,
|
setting.class.Integration,
|
||||||
value.space,
|
value.space,
|
||||||
@ -94,6 +96,8 @@ async function fillMigrationCollaborator (tx: TxOperations): Promise<void> {
|
|||||||
collaborators: [value.createdBy ?? value.modifiedBy]
|
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 {
|
} else {
|
||||||
control.txFactory.createTxMixin<Doc, Collaborators>(
|
const res = control.txFactory.createTxMixin<Doc, Collaborators>(
|
||||||
doc._id,
|
doc._id,
|
||||||
doc._class,
|
doc._class,
|
||||||
doc.space,
|
doc.space,
|
||||||
@ -342,7 +342,7 @@ export async function OnChannelUpdate (tx: Tx, control: TriggerControl): Promise
|
|||||||
collaborators: [tx.modifiedBy]
|
collaborators: [tx.modifiedBy]
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
result.push()
|
result.push(res)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user