chore: fix ContentType usage (#2353)
* chore: fix ContentType usage * chore: fix specs
This commit is contained in:
@@ -2,11 +2,11 @@ import { MutatorClientInterface } from '@standardnotes/services'
|
||||
import { SNTag, TagMutator, TagFolderDelimitter } from '@standardnotes/models'
|
||||
import { ItemManager } from '@Lib/Services'
|
||||
import { lastElement, sortByKey, withoutLastElement } from '@standardnotes/utils'
|
||||
import { ContentType } from '@standardnotes/common'
|
||||
import { ContentType } from '@standardnotes/domain-core'
|
||||
|
||||
export class TagsToFoldersMigrationApplicator {
|
||||
public static isApplicableToCurrentData(itemManager: ItemManager): boolean {
|
||||
const tags = itemManager.getItems<SNTag>(ContentType.Tag)
|
||||
const tags = itemManager.getItems<SNTag>(ContentType.TYPES.Tag)
|
||||
for (const tag of tags) {
|
||||
if (tag.title.includes(TagFolderDelimitter) && !tag.parentId) {
|
||||
return true
|
||||
@@ -17,7 +17,7 @@ export class TagsToFoldersMigrationApplicator {
|
||||
}
|
||||
|
||||
public static async run(itemManager: ItemManager, mutator: MutatorClientInterface): Promise<void> {
|
||||
const tags = itemManager.getItems(ContentType.Tag) as SNTag[]
|
||||
const tags = itemManager.getItems(ContentType.TYPES.Tag) as SNTag[]
|
||||
const sortedTags = sortByKey(tags, 'title')
|
||||
|
||||
for (const tag of sortedTags) {
|
||||
|
||||
Reference in New Issue
Block a user