mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-23 11:31:57 +03:00
Fix integration migration (#3272)
This commit is contained in:
parent
b46b65fe5d
commit
33d46ae734
@ -73,14 +73,15 @@ async function fillMigrationCollaborator (tx: TxOperations): Promise<void> {
|
|||||||
for (const value of settings) {
|
for (const value of settings) {
|
||||||
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)) {
|
const target = collabs.createdBy ?? collabs.modifiedBy
|
||||||
|
if (collabs.collaborators === undefined || !collabs.collaborators.includes(target)) {
|
||||||
const res = tx.txFactory.createTxMixin<Doc, Collaborators>(
|
const res = tx.txFactory.createTxMixin<Doc, Collaborators>(
|
||||||
value._id,
|
value._id,
|
||||||
value._class,
|
value._class,
|
||||||
value.space,
|
value.space,
|
||||||
notification.mixin.Collaborators,
|
notification.mixin.Collaborators,
|
||||||
{
|
{
|
||||||
collaborators: [collabs.createdBy ?? collabs.modifiedBy]
|
collaborators: [target]
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
res.space = core.space.DerivedTx
|
res.space = core.space.DerivedTx
|
||||||
|
Loading…
Reference in New Issue
Block a user