mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-13 03:40:48 +00:00
Remove extra lookup value (#1058)
Signed-off-by: Denis Bykhov <80476319+BykhovDenis@users.noreply.github.com>
This commit is contained in:
parent
6e934b83aa
commit
c7bfa1b295
@ -240,10 +240,20 @@ abstract class MongoAdapterBase extends TxProcessor {
|
||||
for (const row of result) {
|
||||
row.$lookup = {}
|
||||
await this.fillLookupValue(options.lookup, row)
|
||||
this.clearExtraLookups(row)
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
private clearExtraLookups (row: any): void {
|
||||
for (const key in row) {
|
||||
if (key.endsWith('_lookup')) {
|
||||
// eslint-disable-next-line
|
||||
delete row[key]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private checkMixinKey<T extends Doc>(key: string, clazz: Ref<Class<T>>): string {
|
||||
if (!key.includes('.')) {
|
||||
try {
|
||||
|
Loading…
Reference in New Issue
Block a user