@capillarytech/creatives-library 7.1.10 → 7.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -122,13 +122,14 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
122
122
|
}
|
|
123
123
|
if (nextProps.startValidation && nextProps.startValidation !== false && this.props.startValidation !== nextProps.startValidation) {
|
|
124
124
|
this.setState({checkValidation: true});
|
|
125
|
-
this.validateForm(null, null, true, true)
|
|
125
|
+
this.validateForm(null, null, true, true, () => {
|
|
126
126
|
//triggering the saveFormData or onSubmit when validation sets isFormValid to TRUE
|
|
127
|
-
|
|
127
|
+
if (this.state.isFormValid) {
|
|
128
128
|
this.saveForm(true);
|
|
129
|
-
|
|
130
|
-
}
|
|
129
|
+
} else {
|
|
131
130
|
this.props.stopValidation();
|
|
131
|
+
}
|
|
132
|
+
});
|
|
132
133
|
}
|
|
133
134
|
// if (nextProps.saveForm && this.props.saveForm !== nextProps.saveForm) {
|
|
134
135
|
// this.saveForm(saveForm);
|
|
@@ -11,11 +11,8 @@ export function* createTemplate(template) {
|
|
|
11
11
|
try {
|
|
12
12
|
console.log('saga createTemplate mobilepush', template);
|
|
13
13
|
const result = yield call(Api.createMobilePushTemplate, template);
|
|
14
|
-
if (result.message) {
|
|
14
|
+
if (result.message || result.status.code === 500) {
|
|
15
15
|
errorMsg = result.message;
|
|
16
|
-
if(result.status.code>=400){
|
|
17
|
-
throw errorMsg;
|
|
18
|
-
}
|
|
19
16
|
}
|
|
20
17
|
if (template.callback) {
|
|
21
18
|
yield call(template.callback, result.response);
|