Merge pull request #505 from ThibG/glitch-soc/features/fetch-relationships-on-search

[Glitch] Fetch relationships for search results in UI
master
ThibG 7 years ago committed by GitHub
commit 7719fe0df2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      app/javascript/flavours/glitch/actions/search.js

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

Loading…
Cancel
Save