fix: search all collections (#594)

This commit is contained in:
Daniel Lautzenheiser
2023-02-26 17:29:07 -05:00
committed by GitHub
parent 2f04788a92
commit 7369c99a19
6 changed files with 65 additions and 98 deletions

View File

@ -156,9 +156,13 @@ export function selectDefaultSortableFields(collection: Collection, backend: Bac
}
export function selectSortableFields(
collection: Collection,
collection: Collection | undefined,
t: (key: string) => string,
): SortableField[] {
if (!collection) {
return [];
}
const fields = (collection.sortable_fields?.fields ?? [])
.map(key => {
if (key === COMMIT_DATE) {
@ -177,12 +181,12 @@ export function selectSortableFields(
return fields;
}
export function selectViewFilters(collection: Collection) {
return collection.view_filters;
export function selectViewFilters(collection?: Collection) {
return collection?.view_filters;
}
export function selectViewGroups(collection: Collection) {
return collection.view_groups;
export function selectViewGroups(collection?: Collection) {
return collection?.view_groups;
}
export function selectFieldsComments(collection: Collection, entryMap: Entry) {