export const getConditionById = (domenKey, apiKey, id) => {
const domenPath = domen[domenKey],
apiPath = api[apiKey];
return Api.get(`${domenPath}${apiPath}/${id}`).then(res => {
if (res) {
const { data } = res.data;
const body = { ...data };
store.dispatch({
type: `${CREATE_QUESTION}_SET_COND_QUESTION`,
payload: { body }
});
return data;
}
});
};
export const clearCreateQuestion = () =>
store.dispatch({ type: `${T.CREATE_QUESTION}_CLEAR` });
import {
clearCreateQuestion,
getConditionById
} from "../../../../actions";
const mapDispatchToProps = dispatch =>
bindActionCreators({ dispatch }, dispatch);
export default connect(mapStateToProps, mapDispatchToProps)(
CreateConditionComponent
);