From f9fccf7140bb0a2b8b5f3e631dee2eda7e8604ad Mon Sep 17 00:00:00 2001 From: Mo Date: Mon, 8 May 2023 07:16:02 -0500 Subject: [PATCH] chore: fix compound predicates which involve tags --- .../src/Domain/Runtime/Display/Search/ItemWithTags.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/models/src/Domain/Runtime/Display/Search/ItemWithTags.ts b/packages/models/src/Domain/Runtime/Display/Search/ItemWithTags.ts index e92c2dc11..df9a3247c 100644 --- a/packages/models/src/Domain/Runtime/Display/Search/ItemWithTags.ts +++ b/packages/models/src/Domain/Runtime/Display/Search/ItemWithTags.ts @@ -1,3 +1,4 @@ +import { omitByCopy } from '@standardnotes/utils' import { SearchableDecryptedItem } from './Types' import { ItemContent } from '../../../Abstract/Content/ItemContent' import { DecryptedItem } from '../../../Abstract/Item' @@ -15,9 +16,14 @@ export class ItemWithTags extends DecryptedItem implements SearchableDecryptedIt public readonly tags?: SNTag[], ) { super(payload) + this.transferInItemPropertiesSoRootLevelPredicateKeyPathsCanBeMatched(item) this.tags = tags || payload.content.tags } + transferInItemPropertiesSoRootLevelPredicateKeyPathsCanBeMatched(item: SearchableDecryptedItem) { + Object.assign(this, omitByCopy(item, ['title', 'text'])) + } + static Create(payload: DecryptedPayloadInterface, item: SearchableDecryptedItem, tags?: SNTag[]) { return new ItemWithTags(payload as DecryptedPayloadInterface, item, tags) }