Commit 6351ff66 authored by Roman's avatar Roman

BRCD-1762 fix(Play-Product) - remove play field on play change with same...

BRCD-1762 fix(Play-Product) - remove play field on play change with same function as update by passing undefinrd as value
parent ec879c00
......@@ -266,6 +266,7 @@ class Product extends Component {
entityName="rates"
entity={product}
onChangeField={this.onChangeTariffCategory}
onRemoveField={this.onChangeTariffCategory}
fieldsFilter={this.filterTariffCategory}
editable={editable}
/>
......@@ -321,6 +322,7 @@ class Product extends Component {
entityName="rates"
entity={product}
onChangeField={this.onChangeAdditionalField}
onRemoveField={this.onChangeAdditionalField}
highlightPramas={ratingParams}
editable={editable}
/>
......
......@@ -33,8 +33,13 @@ const DefaultRate = Immutable.Record({
export default function (state = defaultState, action) {
switch (action.type) {
case PRODUCT_UPDATE_FIELD_VALUE:
return state.setIn(action.path, action.value);
case PRODUCT_UPDATE_FIELD_VALUE: {
const { path, value } = action;
if (typeof value === 'undefined') {
return state.deleteIn(path);
}
return state.setIn(path, value);
}
case PRODUCT_UPDATE_TO_VALUE: {
return state.updateIn(action.path, Immutable.List(), (list) => {
......
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