Bugfix - merge tag was incorrectly validate when only name was entered and Save was clicked immediately after

This commit is contained in:
Tomas Bures 2018-12-31 10:11:44 +00:00
parent b26f5008da
commit 01720ae128
6 changed files with 17 additions and 17 deletions

View file

@ -73,9 +73,9 @@ export default class CUD extends Component {
entity: PropTypes.object
}
onMailerTypeChanged(mutState, key, oldType, type) {
onMailerTypeChanged(mutStateDate, key, oldType, type) {
if (type) {
this.mailerTypes[type].afterTypeChange(mutState);
this.mailerTypes[type].afterTypeChange(mutStateDate);
}
}

View file

@ -23,12 +23,12 @@ export const mailerTypesOrder = [
export function getMailerTypes(t) {
const mailerTypes = {};
function initFieldsIfMissing(mutState, mailerType) {
function initFieldsIfMissing(mutStateData, mailerType) {
const initVals = mailerTypes[mailerType].initData();
for (const key in initVals) {
if (!mutState.hasIn([key])) {
mutState.setIn([key, 'value'], initVals[key]);
if (!mutStateData.hasIn([key])) {
mutStateData.setIn([key, 'value'], initVals[key]);
}
}
}