Merge branch 'lookup-relationship' into 'develop'

Account lookup: fetch relationship

See merge request soapbox-pub/soapbox-fe!1518
chats-fixes
Alex Gleason 2022-06-09 20:19:59 +00:00
commit 122876025d
2 zmienionych plików z 3 dodań i 1 usunięć

Wyświetl plik

@ -264,7 +264,8 @@ describe('fetchAccountByUsername()', () => {
}); });
expect(actions[1].type).toEqual('ACCOUNTS_IMPORT'); expect(actions[1].type).toEqual('ACCOUNTS_IMPORT');
expect(actions[2].type).toEqual('ACCOUNT_LOOKUP_SUCCESS'); expect(actions[2].type).toEqual('ACCOUNT_LOOKUP_SUCCESS');
expect(actions[3].type).toEqual('ACCOUNT_FETCH_SUCCESS'); expect(actions[3].type).toEqual('RELATIONSHIPS_FETCH_REQUEST');
expect(actions[4].type).toEqual('ACCOUNT_FETCH_SUCCESS');
}); });
}); });

Wyświetl plik

@ -176,6 +176,7 @@ export function fetchAccountByUsername(username, history) {
}); });
} else if (features.accountLookup) { } else if (features.accountLookup) {
return dispatch(accountLookup(username)).then(account => { return dispatch(accountLookup(username)).then(account => {
dispatch(fetchRelationships([account.id]));
dispatch(fetchAccountSuccess(account)); dispatch(fetchAccountSuccess(account));
}).catch(error => { }).catch(error => {
dispatch(fetchAccountFail(null, error)); dispatch(fetchAccountFail(null, error));