Display follow suggestions
This commit is contained in:
@ -6,10 +6,32 @@ export const SUGGESTIONS_FETCH_FAIL = 'SUGGESTIONS_FETCH_FAIL';
|
||||
|
||||
export function fetchSuggestions() {
|
||||
return (dispatch, getState) => {
|
||||
dispatch(fetchSuggestionsRequest());
|
||||
|
||||
api(getState).get('/api/v1/accounts/suggestions').then(response => {
|
||||
console.log(response.data);
|
||||
dispatch(fetchSuggestionsSuccess(response.data));
|
||||
}).catch(error => {
|
||||
console.error(error);
|
||||
dispatch(fetchSuggestionsFail(error));
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
export function fetchSuggestionsRequest() {
|
||||
return {
|
||||
type: SUGGESTIONS_FETCH_REQUEST
|
||||
};
|
||||
};
|
||||
|
||||
export function fetchSuggestionsSuccess(suggestions) {
|
||||
return {
|
||||
type: SUGGESTIONS_FETCH_SUCCESS,
|
||||
suggestions: suggestions
|
||||
};
|
||||
};
|
||||
|
||||
export function fetchSuggestionsFail(error) {
|
||||
return {
|
||||
type: SUGGESTIONS_FETCH_FAIL,
|
||||
error: error
|
||||
};
|
||||
};
|
||||
|
Reference in New Issue
Block a user