Fetch relationships after getting familiar followers
This commit is contained in:
parent
ecdbee271b
commit
985022f857
1 changed files with 4 additions and 0 deletions
|
@ -2,8 +2,11 @@ import { AppDispatch, RootState } from 'soapbox/store';
|
||||||
|
|
||||||
import api from '../api';
|
import api from '../api';
|
||||||
|
|
||||||
|
import { fetchRelationships } from './accounts';
|
||||||
import { importFetchedAccounts } from './importer';
|
import { importFetchedAccounts } from './importer';
|
||||||
|
|
||||||
|
import type { APIEntity } from 'soapbox/types/entities';
|
||||||
|
|
||||||
export const FAMILIAR_FOLLOWERS_FETCH_REQUEST = 'FAMILIAR_FOLLOWERS_FETCH_REQUEST';
|
export const FAMILIAR_FOLLOWERS_FETCH_REQUEST = 'FAMILIAR_FOLLOWERS_FETCH_REQUEST';
|
||||||
export const FAMILIAR_FOLLOWERS_FETCH_SUCCESS = 'FAMILIAR_FOLLOWERS_FETCH_SUCCESS';
|
export const FAMILIAR_FOLLOWERS_FETCH_SUCCESS = 'FAMILIAR_FOLLOWERS_FETCH_SUCCESS';
|
||||||
export const FAMILIAR_FOLLOWERS_FETCH_FAIL = 'FAMILIAR_FOLLOWERS_FETCH_FAIL';
|
export const FAMILIAR_FOLLOWERS_FETCH_FAIL = 'FAMILIAR_FOLLOWERS_FETCH_FAIL';
|
||||||
|
@ -19,6 +22,7 @@ export const fetchAccountFamiliarFollowers = (accountId: string) => (dispatch: A
|
||||||
const accounts = data.find(({ id }: { id: string }) => id === accountId).accounts;
|
const accounts = data.find(({ id }: { id: string }) => id === accountId).accounts;
|
||||||
|
|
||||||
dispatch(importFetchedAccounts(accounts));
|
dispatch(importFetchedAccounts(accounts));
|
||||||
|
dispatch(fetchRelationships(accounts.map((item: APIEntity) => item.id)));
|
||||||
dispatch({
|
dispatch({
|
||||||
type: FAMILIAR_FOLLOWERS_FETCH_SUCCESS,
|
type: FAMILIAR_FOLLOWERS_FETCH_SUCCESS,
|
||||||
id: accountId,
|
id: accountId,
|
||||||
|
|
Loading…
Reference in a new issue