First Step

This commit is contained in:
Belen Curcio
2017-02-06 23:23:08 -03:00
parent 77f090fd3c
commit 3a953c7efe
+10 -4
View File
@@ -15,9 +15,7 @@ const addError = (name, error) => ({type: actions.ADD_ERROR, name, error});
const hasError = error => ({type: actions.HAS_ERROR, error});
const clearErrors = () => ({type: actions.CLEAR_ERRORS});
export const submitSettings = () => (dispatch, getState) => {
const formData = getState().install.toJS().data.settings;
const validation = (formData, dispatch, next) => {
if (!(formData != null)) {
return dispatch(hasError());
}
@@ -50,7 +48,15 @@ export const submitSettings = () => (dispatch, getState) => {
return dispatch(hasError('Please check the form'));
}
return dispatch(clearErrors());
dispatch(clearErrors());
next();
};
export const submitSettings = () => (dispatch, getState) => {
const formData = getState().install.toJS().data.settings;
validation(formData, dispatch, function() {
dispatch(nextStep());
});
};
export const install = () => dispatch => {