MCPcopy Create free account
hub / github.com/Lobos/react-ui / submit

Method submit

src/Form.js:112–137  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

110 }
111
112 submit () {
113 let success = this.validate();
114 if (success && this.props.beforeSubmit) {
115 success = this.props.beforeSubmit();
116 }
117
118 if (!success) {
119 return;
120 }
121
122 if (this.props.onSubmit) {
123 // send clone data
124 let data = clone(this.state.data);
125
126 // remove ignore value
127 forEach(this.items, (item) => {
128 if (item.ignore) {
129 delete data[item.name];
130 }
131 });
132
133 this.props.onSubmit(data);
134 }
135
136 return true;
137 }
138
139 renderControls () {
140 const { data } = this.state;

Callers 1

handleSubmitMethod · 0.95

Calls 3

validateMethod · 0.95
forEachFunction · 0.90
cloneFunction · 0.85

Tested by

no test coverage detected