Commit 79d5bd8f authored by Roman's avatar Roman

BRCD-1676 feat(Play) - removed play related data on play remove

parent 8543732b
......@@ -76,9 +76,14 @@ export default class Plan extends Component {
this.props.onChangeFieldValue(['description'], value);
}
onChangePlays = (plays) => {
onChangePlays = (plays, playWasRemoved = false) => {
const playsToSave = plays === '' ? [] : plays.split(',');
this.props.onChangeFieldValue(['play'], Immutable.List(playsToSave));
if (playWasRemoved) {
this.props.onChangeFieldValue(['rates'], Immutable.Map());
this.props.onChangeFieldValue(['include', 'groups'], Immutable.Map());
this.props.onChangeFieldValue(['include', 'services'], Immutable.List());
}
}
onChangePlanEach = (e) => {
......
......@@ -71,9 +71,13 @@ export default class ServiceDetails extends Component {
this.props.updateItem(['quantitative'], value);
}
onChangePlays = (plays) => {
onChangePlays = (plays, playWasRemoved = false) => {
const playsToSave = plays === '' ? [] : plays.split(',');
this.props.updateItem(['play'], Immutable.List(playsToSave));
if (playWasRemoved) {
this.props.updateItem(['rates'], Immutable.Map());
this.props.updateItem(['include', 'groups'], Immutable.Map());
}
}
onChangeDescription = (e) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment