X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/244bfe2909565499833b7e2ce387adfd81e1cba6..23c3b5d3792225aafe5b66d81263aa1d3d42eeb9:/src/store/search-bar/search-bar-reducer.ts diff --git a/src/store/search-bar/search-bar-reducer.ts b/src/store/search-bar/search-bar-reducer.ts index 97e22d7e..048cfea1 100644 --- a/src/store/search-bar/search-bar-reducer.ts +++ b/src/store/search-bar/search-bar-reducer.ts @@ -3,10 +3,13 @@ // SPDX-License-Identifier: AGPL-3.0 import { searchBarActions, SearchBarActions } from '~/store/search-bar/search-bar-actions'; +import { GroupContentsResource } from '~/services/groups-service/groups-service'; interface SearchBar { currentView: string; open: boolean; + searchResults: GroupContentsResource[]; + searchValue: string; } export enum SearchView { @@ -17,7 +20,9 @@ export enum SearchView { const initialState: SearchBar = { currentView: SearchView.BASIC, - open: false + open: false, + searchResults: [], + searchValue: '' }; export const searchBarReducer = (state = initialState, action: SearchBarActions): SearchBar => @@ -25,5 +30,7 @@ export const searchBarReducer = (state = initialState, action: SearchBarActions) SET_CURRENT_VIEW: currentView => ({ ...state, currentView }), OPEN_SEARCH_VIEW: () => ({ ...state, open: true }), CLOSE_SEARCH_VIEW: () => ({ ...state, open: false }), + SET_SEARCH_RESULTS: (searchResults) => ({ ...state, searchResults }), + SET_SEARCH_VALUE: (searchValue) => ({ ...state, searchValue }), default: () => state }); \ No newline at end of file