X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/318fb9f2f730f376bbb4fe7afec567b7ca80aabe..89c3c647797787377f4d950b38d320ee3b28e92c:/src/store/search-results-panel/search-results-middleware-service.ts diff --git a/src/store/search-results-panel/search-results-middleware-service.ts b/src/store/search-results-panel/search-results-middleware-service.ts index 0b38444205..1bd294f112 100644 --- a/src/store/search-results-panel/search-results-middleware-service.ts +++ b/src/store/search-results-panel/search-results-middleware-service.ts @@ -16,6 +16,7 @@ import { GroupContentsResource, GroupContentsResourcePrefix } from "~/services/g import { ListResults } from '~/services/common-service/common-resource-service'; import { searchResultsPanelActions } from '~/store/search-results-panel/search-results-panel-actions'; import { getFilters } from '~/store/search-bar/search-bar-actions'; +import { getSortColumn } from "~/store/data-explorer/data-explorer-reducer"; export class SearchResultsMiddlewareService extends DataExplorerMiddlewareService { constructor(private services: ServiceRepository, id: string) { @@ -28,7 +29,7 @@ export class SearchResultsMiddlewareService extends DataExplorerMiddlewareServic const dataExplorer = getDataExplorer(state.dataExplorer, this.getId()); const searchValue = state.searchBar.searchValue; try { - const response = await this.services.groupsService.contents(userUuid, getParams(dataExplorer, searchValue)); + const response = await this.services.groupsService.contents('', getParams(dataExplorer, searchValue)); api.dispatch(updateResources(response.items)); api.dispatch(setItems(response)); } catch { @@ -39,12 +40,12 @@ export class SearchResultsMiddlewareService extends DataExplorerMiddlewareServic export const getParams = (dataExplorer: DataExplorer, searchValue: string) => ({ ...dataExplorerToListParams(dataExplorer), - filters: getFilters('name', searchValue, {}), + filters: getFilters('name', searchValue), order: getOrder(dataExplorer) }); const getOrder = (dataExplorer: DataExplorer) => { - const sortColumn = dataExplorer.columns.find(c => c.sortDirection !== SortDirection.NONE); + const sortColumn = getSortColumn(dataExplorer); const order = new OrderBuilder(); if (sortColumn) { const sortDirection = sortColumn && sortColumn.sortDirection === SortDirection.ASC @@ -72,4 +73,4 @@ const couldNotFetchWorkflows = () => snackbarActions.OPEN_SNACKBAR({ message: 'Could not fetch workflows.', kind: SnackbarKind.ERROR - }); \ No newline at end of file + });