mirror of
https://github.com/hcengineering/platform.git
synced 2024-11-22 21:50:34 +03:00
UBER-560: filter out current transaction and get mixin (#3480)
Signed-off-by: Vyacheslav Tumanov <me@slavatumanov.me>
This commit is contained in:
parent
352404533b
commit
a0ecb3c04f
@ -631,8 +631,9 @@ async function updateCollaboratorsMixin (
|
||||
const mixinTxes = await control.findAll(core.class.TxMixin, {
|
||||
objectId: tx.objectId
|
||||
})
|
||||
const prevDoc = TxProcessor.buildDoc2Doc([createTx, ...mixinTxes]) as Collaborators
|
||||
const set = new Set(prevDoc?.collaborators ?? [])
|
||||
const prevDoc = TxProcessor.buildDoc2Doc([createTx, ...mixinTxes].filter((t) => t._id !== tx._id)) as Collaborators
|
||||
const prevDocMixin = control.hierarchy.as(prevDoc, notification.mixin.Collaborators)
|
||||
const set = new Set(prevDocMixin?.collaborators ?? [])
|
||||
const newCollabs: Ref<Account>[] = []
|
||||
for (const collab of tx.attributes.collaborators) {
|
||||
if (!set.has(collab)) {
|
||||
|
Loading…
Reference in New Issue
Block a user