cleared worktype request success/errors on unmount

master
Alexander Wong 7 years ago
parent 204e83a2a8
commit 3c5aa92840
  1. 6
      src/components/Worktype/UpdateWorkTypeForm.jsx

@ -6,7 +6,9 @@ import { Container, Form, Header, Label, Message } from "semantic-ui-react";
import { import {
setFormWorktypeColor, setFormWorktypeColor,
setFormWorktypeLabel setFormWorktypeLabel,
clearWorktypeRequestSuccess,
clearWorktypeRequestError,
} from "../../actions/worktype/reducer.actions"; } from "../../actions/worktype/reducer.actions";
import { import {
updateWorktypeRequest, updateWorktypeRequest,
@ -23,6 +25,8 @@ class UpdateWorkTypeForm extends Component {
componentWillUnmount = () => { componentWillUnmount = () => {
this.props.dispatch(setFormWorktypeColor("")); this.props.dispatch(setFormWorktypeColor(""));
this.props.dispatch(setFormWorktypeLabel("")); this.props.dispatch(setFormWorktypeLabel(""));
this.props.dispatch(clearWorktypeRequestSuccess());
this.props.dispatch(clearWorktypeRequestError());
}; };
changeColor = color => { changeColor = color => {

Loading…
Cancel
Save