From 59d1e2eb37488f2d90b3e135788cab151cd037c8 Mon Sep 17 00:00:00 2001 From: Andrey Sobolev Date: Fri, 28 Apr 2023 14:33:12 +0700 Subject: [PATCH] TSK-1393: Fix status findAll requests extra data (#3105) Signed-off-by: Andrey Sobolev --- packages/presentation/src/status.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/packages/presentation/src/status.ts b/packages/presentation/src/status.ts index 10c4681d59..98c5d3b791 100644 --- a/packages/presentation/src/status.ts +++ b/packages/presentation/src/status.ts @@ -257,13 +257,12 @@ export class StatusMiddleware extends BasePresentationMiddleware implements Pres ;(query as any)[attr.name].$nin = targetNin } } - - if (finalOptions.lookup !== undefined) { - // Remove lookups by status field - if ((finalOptions.lookup as any)[attr.name] !== undefined) { - const { [attr.name]: _, ...newLookup } = finalOptions.lookup as any - finalOptions.lookup = newLookup - } + } + if (finalOptions.lookup !== undefined) { + // Remove lookups by status field + if ((finalOptions.lookup as any)[attr.name] !== undefined) { + const { [attr.name]: _, ...newLookup } = finalOptions.lookup as any + finalOptions.lookup = newLookup } }