[Glitch] Fetch relationships for search results in UI

Port webui changes from 750f3e64c9 to glitch-soc
lolsob-rspec
Thibaut Girka 2018-05-22 13:05:40 +02:00
parent 4749fe5019
commit cdb1d08119
1 changed files with 2 additions and 0 deletions

View File

@ -1,4 +1,5 @@
import api from 'flavours/glitch/util/api';
import { fetchRelationships } from './accounts';
export const SEARCH_CHANGE = 'SEARCH_CHANGE';
export const SEARCH_CLEAR = 'SEARCH_CLEAR';
@ -38,6 +39,7 @@ export function submitSearch() {
},
}).then(response => {
dispatch(fetchSearchSuccess(response.data));
dispatch(fetchRelationships(response.data.accounts.map(item => item.id)));
}).catch(error => {
dispatch(fetchSearchFail(error));
});