Code for removing user from db still in progress (commented out)

This commit is contained in:
Aaron Sun
2019-10-24 15:27:20 -04:00
parent 45f88861c8
commit eea2f56b49
3 changed files with 44 additions and 31 deletions

View File

@@ -7,7 +7,7 @@ import Button from "@material-ui/core/Button";
import withStyles from "@material-ui/core/styles/withStyles";
// Redux stuff
import { deleteUser } from "../redux/actions/userActions";
import { logoutUser } from "../redux/actions/userActions";
import { connect } from "react-redux";
const styles = {
@@ -32,7 +32,7 @@ const styles = {
export class Delete extends Component {
componentDidMount() {
this.props.deleteUser();
this.props.logoutUser();
this.props.history.push('/');
}
@@ -45,10 +45,10 @@ const mapStateToProps = (state) => ({
user: state.user
});
const mapActionsToProps = { deleteUser };
const mapActionsToProps = { logoutUser };
Delete.propTypes = {
deleteUser: PropTypes.func.isRequired,
logoutUser: PropTypes.func.isRequired,
user: PropTypes.object.isRequired,
classes: PropTypes.object.isRequired
};