Merge pull request #327 from hcengineering/fix-duplicate-activity

Fix duplicate activity
This commit is contained in:
Andrey Platov 2021-11-19 08:52:38 +01:00 committed by GitHub
commit 7ebf33e04e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -53,7 +53,11 @@ abstract class MongoAdapterBase extends TxProcessor {
translated[key] = value
}
const classes = this.hierarchy.getDescendants(clazz)
translated._class = { $in: classes }
// Only replace if not specified
if (translated._class?.$in === undefined) {
translated._class = { $in: classes }
}
// return Object.assign({}, query, { _class: { $in: classes } })
return translated
}