import { Observable } from 'rxjs'
import { Results } from 'src/app/data/results'
import { FilterRule } from 'src/app/data/filter-rule'
-import { map } from 'rxjs/operators'
+import { map, tap } from 'rxjs/operators'
import { CorrespondentService } from './correspondent.service'
import { DocumentTypeService } from './document-type.service'
import { TagService } from './tag.service'
doc.document_type$ = this.documentTypeService.getCached(doc.document_type)
}
if (doc.tags) {
- doc.tags$ = this.tagService.getCachedMany(doc.tags)
+ doc.tags$ = this.tagService
+ .getCachedMany(doc.tags)
+ .pipe(
+ tap((tags) =>
+ tags.sort((tagA, tagB) => tagA.name.localeCompare(tagB.name))
+ )
+ )
}
if (doc.storage_path) {
doc.storage_path$ = this.storagePathService.getCached(doc.storage_path)