From c703fbd2e09a9c44b96ac0c13e7542c768b38a38 Mon Sep 17 00:00:00 2001 From: Denis Bykhov <80476319+BykhovDenis@users.noreply.github.com> Date: Wed, 1 Jun 2022 18:13:50 +0600 Subject: [PATCH] Reorder lookup fix (#1971) Signed-off-by: Denis Bykhov <80476319+BykhovDenis@users.noreply.github.com> --- plugins/view-resources/src/utils.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/view-resources/src/utils.ts b/plugins/view-resources/src/utils.ts index 92d03420ba..8af29d96d8 100644 --- a/plugins/view-resources/src/utils.ts +++ b/plugins/view-resources/src/utils.ts @@ -178,7 +178,9 @@ function getKeyLookup ( const lookupClass = (attribute.type as RefTo).to const index = key.indexOf('$lookup', lastIndex) if (index === -1) { - ;(lookup as any)[attrib] = lookupClass + if ((lookup as any)[attrib] === undefined) { + ;(lookup as any)[attrib] = lookupClass + } } else { let nested = Array.isArray((lookup as any)[attrib]) ? (lookup as any)[attrib][1] : {} nested = getKeyLookup(hierarchy, lookupClass, key.slice(index), nested)