Skip to content
Snippets Groups Projects
mentors.js 311 B
Newer Older
  • Learn to ignore specific revisions
  • Rafael László's avatar
    Rafael László committed
    import { GET_MENTORS } from './types';
    
    Rafael László's avatar
    Rafael László committed
    import axios from './session';
    
    Rafael László's avatar
    Rafael László committed
    
    
    Rafael László's avatar
    Rafael László committed
    export const getMentors = () => async (dispatch) => {
      try {
        const response = await axios.get('/api/v1/mentors');
        dispatch({
          type: GET_MENTORS,
          payload: response.data,
        });
      } catch (e) {
        console.log(e);
    
    Rafael László's avatar
    Rafael László committed
      }
    
    Rafael László's avatar
    Rafael László committed
    };