Devendra174's picture
Upload folder using huggingface_hub
f5071ca verified
raw
history blame contribute delete
682 Bytes
import { connect } from 'react-redux';
import { withRouter } from 'react-router-dom';
import PostForm from './post_form';
import { createPost,fetchAllPosts } from '../../actions/post_actions';
const mapStateToProps = (state, ownProps) => {
const post = { body: '' };
const formType = 'Create Post';
const currentUserId = state.session.id;
return { post,currentUser:state.entities.users[currentUserId],
formType};
};
const mapDispatchToProps = (dispatch) => {
return {
action: post => dispatch(createPost(post)).then(()=>fetchAllPosts()),
fetch: ()=> dispatch(fetchAllPosts())
};
};
export default connect(mapStateToProps, mapDispatchToProps)(PostForm);