{"size": 504, "ext": "js", "max_stars_repo_path": "frontend/src/store/actions/tagsActions.js", "max_stars_repo_name": "farhad0085/django-money-management", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "frontend/src/store/actions/tagsActions.js", "max_issues_repo_name": "farhad0085/django-money-management", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "frontend/src/store/actions/tagsActions.js", "max_forks_repo_name": "farhad0085/django-money-management", "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": 29.6470588235, "max_line_length": 86, "alphanum_fraction": 0.626984127}
import * as Types from "./actionTypes";
import axios from "../../utils/axios";
import { getHeaders, getTagsList } from '../../utils';


export const createTags = (tagsRawData) => dispatch => {
    const tags = getTagsList(tagsRawData)

    axios.post("/tags/", tags, { headers: getHeaders()})
    .then(res => {
        console.log(res.data);
    })
    .catch(error => {
        console.log(error.response);
        dispatch({type: Types.TRANSACTION_CREATE_ERROR, payload: error.response.data})
    })
}