{"size": 1480, "ext": "js", "max_stars_repo_path": "src/modules/app/store/effects/user.effects.js", "max_stars_repo_name": "EvgeniiShumeiko/megahack2018_frontend", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/modules/app/store/effects/user.effects.js", "max_issues_repo_name": "EvgeniiShumeiko/megahack2018_frontend", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/modules/app/store/effects/user.effects.js", "max_forks_repo_name": "EvgeniiShumeiko/megahack2018_frontend", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 38.9473684211, "max_line_length": 156, "alphanum_fraction": 0.6628378378}
import {
    setUserAction,
} from '@app/store/actions';
import axios from 'axios';
import moment from 'moment';

import environment from '@core/environment.json';

const url = environment.API.HOST

export const setUser = user => dispatch => {
    dispatch(
        setUserAction(user),
    );
};

export const getExchangeTask = () => axios.get(url + '/task/free', { headers: { authorization: localStorage.getItem('secretKey') }})
        .then(res => res.data);

export const getPersonalTask = () => axios.get(url + '/task/list', { headers: { authorization: localStorage.getItem('secretKey') }})
    .then(res => res.data);

export const getMentor = () => axios.get(url + '/account/developer', { headers: { authorization: localStorage.getItem('secretKey') }})
    .then(res => res.data.mentor);

export const getMe = () => axios.get(url + '/account/info', { headers: { authorization: localStorage.getItem('secretKey') }})
    .then(res => res.data.login);

export const getMentors = () => axios.get(url + '/account/mentors', { headers: { authorization: localStorage.getItem('secretKey') }})
    .then(res => res.data);

export const setMentor = (login) => axios.post(url + `/account/set_mentor/${login}`, null, { headers: { authorization: localStorage.getItem('secretKey') }})
    .then(res => res.data);

export const acceptTask = (id) => axios.post(url + `/task/accept/${id}`, null, { headers: { authorization: localStorage.getItem('secretKey')}})
    .then(res => res.data);

