import axios from 'axios';
import * as constants from '../utils/constants';
export function getQuestions() {
    return function (dispatch) {
        dispatch({ type: constants.PROFILE_QUESTIONS_GETTING });
        axios({
            method: 'post',
            url: `${constants.baseAPIUrl}question/profile`,
            headers: { Authorization: `Bearer ${localStorage.getItem('token')}` },
        })
            .then((response) => {
                dispatch({ type: constants.PROFILE_QUESTIONS_GOT, payload: response.data })
            })
            .catch((err) => {
                dispatch({ type: constants.PROFILE_QUESTIONS_ERROR, payload: err });
            });
    };
}