cleared worktype request success/errors on unmount

This commit is contained in:
Alexander Wong 2017-09-25 23:21:21 -06:00
parent 204e83a2a8
commit 3c5aa92840

View File

@ -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 => {