(changeData)
| 98 | }; |
| 99 | |
| 100 | const save = (changeData) => { |
| 101 | props.onSave(schemaState.isNew, changeData) |
| 102 | .then(()=>{ |
| 103 | if(schema.informText) { |
| 104 | Notifier.alert( |
| 105 | gettext('Warning'), |
| 106 | schema.informText, |
| 107 | ); |
| 108 | } |
| 109 | }).catch((err)=>{ |
| 110 | schemaState.setError({ |
| 111 | name: 'apierror', |
| 112 | message: _.escape(parseApiError(err)), |
| 113 | }); |
| 114 | }).finally(()=>{ |
| 115 | if(checkIsMounted()) { |
| 116 | setSaving(false); |
| 117 | setLoaderText(''); |
| 118 | } |
| 119 | }); |
| 120 | }; |
| 121 | |
| 122 | const onSaveClick = () => { |
| 123 | // Do nothing when there is no change or there is an error |
no test coverage detected