about summary refs log tree commit diff
path: root/app/assets/javascripts/components/actions/suggestions.jsx
blob: 562a901c5cd62aecf13e3bacad1f10e17d15e380 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import api from '../api';

export const SUGGESTIONS_FETCH_REQUEST = 'SUGGESTIONS_FETCH_REQUEST';
export const SUGGESTIONS_FETCH_SUCCESS = 'SUGGESTIONS_FETCH_SUCCESS';
export const SUGGESTIONS_FETCH_FAIL    = 'SUGGESTIONS_FETCH_FAIL';

export function fetchSuggestions() {
  return (dispatch, getState) => {
    api(getState).get('/api/v1/accounts/suggestions').then(response => {
      console.log(response.data);
    }).catch(error => {
      console.error(error);
    });
  };
};