|
|
@@ -4,7 +4,7 @@ import PropTypes from "prop-types";
|
|
|
import Link from "next/link";
|
|
|
import { UncontrolledDropdown, DropdownToggle, DropdownMenu, DropdownItem, ListGroup, ListGroupItem } from "reactstrap";
|
|
|
import { logout } from "@/actions/auth";
|
|
|
-
|
|
|
+import { createLog } from "../../actions/log";
|
|
|
import { connect } from "react-redux";
|
|
|
import { bindActionCreators } from "redux";
|
|
|
import * as actions from "../../store/actions/actions";
|
|
|
@@ -58,6 +58,7 @@ class Header extends Component {
|
|
|
handleLogout = async (e) => {
|
|
|
e.preventDefault();
|
|
|
// await logout();
|
|
|
+ await createLog(this.props.token, { aktivitas: "Berhasil Logout" });
|
|
|
this.props.tokenNull();
|
|
|
this.props.userNull();
|
|
|
// if (cek.success) {
|
|
|
@@ -224,7 +225,7 @@ Header.propTypes = {
|
|
|
settings: PropTypes.object,
|
|
|
};
|
|
|
|
|
|
-const mapStateToProps = (state) => ({ settings: state.settings });
|
|
|
+const mapStateToProps = (state) => ({ settings: state.settings, token: state.token });
|
|
|
const mapDispatchToProps = (dispatch) => ({
|
|
|
actions: bindActionCreators(actions, dispatch),
|
|
|
tokenNull: () => dispatch({ type: "SET_TOKEN", payload: null }),
|