Commit ec879c00 authored by Roman's avatar Roman

BRCD-1762 fix(Plays-Service) - remove play field on play change with same...

BRCD-1762 fix(Plays-Service) - remove play field on play change with same function as update by passing undefinrd as value
parent 2db1d4c1
......@@ -89,10 +89,6 @@ export default class ServiceDetails extends Component {
this.props.updateItem(field, value);
}
onRemoveAdditionalField = (field) => {
this.props.updateItem(field, null);
}
onChangeServicePeriodType = (e) => {
const { value } = e.target;
this.props.updateItem(['balance_period', 'type'], value);
......@@ -283,7 +279,7 @@ export default class ServiceDetails extends Component {
entityName="services"
entity={item}
onChangeField={this.onChangeAdditionalField}
onRemoveField={this.onRemoveAdditionalField}
onRemoveField={this.onChangeAdditionalField}
editable={editable}
/>
......
......@@ -37,7 +37,7 @@ const serviceReducer = (state = DefaultState, action) => {
case UPDATE_SERVICE: {
const { path, value } = action;
if (value === null) {
if (typeof value === 'undefined') {
return state.deleteIn(path);
}
return state.setIn(path, value);
......
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