{"size": 795, "ext": "js", "max_stars_repo_path": "clients/src/actions/auth.js", "max_stars_repo_name": "SakibHasanCse/psql", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "clients/src/actions/auth.js", "max_issues_repo_name": "SakibHasanCse/psql", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "clients/src/actions/auth.js", "max_forks_repo_name": "SakibHasanCse/psql", "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": 33.125, "max_line_length": 82, "alphanum_fraction": 0.6264150943}
import ApiCall from '../ApiCall/index'

export const signUp = (dispatch) => async(user) => {
    try {
        dispatch({ type: 'SIGNUP_USER_LOADDING', })
        const response = await ApiCall('auth/signup', 'POST', user)
        return dispatch({ type: 'SIGNUP_USER_SUCCESS', payload: response.data })
    } catch (err) {
        return dispatch({ type: 'SIGNUP_USER_ERROR', payload: err.response.data })
    }


}
export const signIn = async(user) => async dispatch => {
    try {
        dispatch({ type: 'SIGN_USER_LOADDING', })
        const response = await ApiCall('auth/signin', 'POST', user)
        return dispatch({ type: 'SIGNIN_USER_SUCCESS', payload: response.data })
    } catch (err) {
        return dispatch({ type: 'SIGNIN_USER_ERROR', payload: err.response.data })
    }


}