mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-20 07:10:02 +00:00
Reorder lookup fix (#1971)
Signed-off-by: Denis Bykhov <80476319+BykhovDenis@users.noreply.github.com>
This commit is contained in:
parent
ae6ee89582
commit
c703fbd2e0
@ -178,7 +178,9 @@ function getKeyLookup<T extends Doc> (
|
|||||||
const lookupClass = (attribute.type as RefTo<Doc>).to
|
const lookupClass = (attribute.type as RefTo<Doc>).to
|
||||||
const index = key.indexOf('$lookup', lastIndex)
|
const index = key.indexOf('$lookup', lastIndex)
|
||||||
if (index === -1) {
|
if (index === -1) {
|
||||||
;(lookup as any)[attrib] = lookupClass
|
if ((lookup as any)[attrib] === undefined) {
|
||||||
|
;(lookup as any)[attrib] = lookupClass
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
let nested = Array.isArray((lookup as any)[attrib]) ? (lookup as any)[attrib][1] : {}
|
let nested = Array.isArray((lookup as any)[attrib]) ? (lookup as any)[attrib][1] : {}
|
||||||
nested = getKeyLookup(hierarchy, lookupClass, key.slice(index), nested)
|
nested = getKeyLookup(hierarchy, lookupClass, key.slice(index), nested)
|
||||||
|
Loading…
Reference in New Issue
Block a user