chore: fix compound predicates which involve tags
This commit is contained in:
@@ -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<ItemContent>, item: SearchableDecryptedItem, tags?: SNTag[]) {
|
||||
return new ItemWithTags(payload as DecryptedPayloadInterface<ItemWithTagsContent>, item, tags)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user