+export const searchData = (searchValue: string) =>
+ async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
+ const currentView = getState().searchBar.currentView;
+ dispatch(searchBarActions.SET_SEARCH_VALUE(searchValue));
+ dispatch(searchBarActions.SET_SEARCH_RESULTS([]));
+ dispatch<any>(searchGroups(searchValue));
+ if (currentView === SearchView.BASIC) {
+ dispatch(searchBarActions.CLOSE_SEARCH_VIEW());
+ dispatch(navigateToSearchResults);
+ }
+
+ };
+
+export const searchAdvanceData = (data: SearchBarAdvanceFormData) =>
+ async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
+ const searchValue = getState().searchBar.searchValue;
+ dispatch<any>(saveQuery(data));
+ dispatch<any>(searchGroups(searchValue, 100, data.type));
+ dispatch(searchBarActions.SET_CURRENT_VIEW(SearchView.BASIC));
+ dispatch(searchBarActions.CLOSE_SEARCH_VIEW());
+ dispatch(navigateToSearchResults);
+ };
+