mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-01 00:08:27 +01:00
Push errors onto state
This commit is contained in:
parent
a360894f89
commit
d65c9854e4
@ -84,7 +84,7 @@ var ErrorMessages = React.createClass({
|
|||||||
}
|
}
|
||||||
|
|
||||||
var errorNodes = this.props.errors.map(function(e) {
|
var errorNodes = this.props.errors.map(function(e) {
|
||||||
return (<li>{e}</li>);
|
return (<li key={e}>{e}</li>);
|
||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -118,7 +118,7 @@ var Unleash = React.createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
handleError: function (error) {
|
handleError: function (error) {
|
||||||
window.alert(error);
|
this.state.errors.push(error);
|
||||||
},
|
},
|
||||||
|
|
||||||
updateFeature: function (changeRequest) {
|
updateFeature: function (changeRequest) {
|
||||||
@ -138,7 +138,7 @@ var Unleash = React.createClass({
|
|||||||
contentType: 'application/json',
|
contentType: 'application/json',
|
||||||
data: JSON.stringify(changeRequest)
|
data: JSON.stringify(changeRequest)
|
||||||
}).then(function() {
|
}).then(function() {
|
||||||
}, this.handleError.bind(this));
|
}, this.handleError);
|
||||||
},
|
},
|
||||||
|
|
||||||
createFeature: function (feature) {
|
createFeature: function (feature) {
|
||||||
|
Loading…
Reference in New Issue
Block a user