From d0298fee380afec313f3676f524e5f65f19e210f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cjeramysoucy=E2=80=9D?= Date: Fri, 13 Oct 2023 08:30:06 -0400 Subject: [PATCH] Fixes comment and removes unnecessary const --- .../src/lib/apis/utils/find_shared_origin_objects.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/apis/utils/find_shared_origin_objects.ts b/packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/apis/utils/find_shared_origin_objects.ts index 8db6f775f66bd..e2408570307a9 100644 --- a/packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/apis/utils/find_shared_origin_objects.ts +++ b/packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/apis/utils/find_shared_origin_objects.ts @@ -116,14 +116,13 @@ function createOriginKueryFilter( // If we are updating an object's spaces (as opposed to copying)... if (purpose === 'updateObjectsSpaces') { - // we never want to match if the raw document `_id` fields. + // we never want to match on the raw document `_id` fields. // If they are equal, this just means that the object already exists in that space and it's ok. - const idMatch = buildNode( + const notIdMatch = buildNode(KQL_FUNCTION_NOT, buildNode( KQL_FUNCTION_IS, `${type}.id`, esKuery.escapeKuery(`${type}:${id}`) - ); - const notIdMatch = buildNode(KQL_FUNCTION_NOT, idMatch); + )); // If this object has an origin ID, then we do still want to match if another object's ID matches the // object's origin (idMatchesOrigin), or if another object's origin matches the object's origin (originMatch).