mirror of
https://github.com/ascribe/onion.git
synced 2024-12-23 01:39:36 +01:00
modal error
This commit is contained in:
parent
76317dcdca
commit
3c3504d773
@ -39,6 +39,9 @@ let ShareModal = React.createClass({
|
|||||||
});
|
});
|
||||||
|
|
||||||
let ShareForm = React.createClass({
|
let ShareForm = React.createClass({
|
||||||
|
getInitialState(){
|
||||||
|
return {errors: []}
|
||||||
|
},
|
||||||
submit(e) {
|
submit(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
let url = "http://localhost:8000/api/ownership/shares/mail/";
|
let url = "http://localhost:8000/api/ownership/shares/mail/";
|
||||||
@ -51,6 +54,14 @@ let ShareForm = React.createClass({
|
|||||||
},
|
},
|
||||||
body: JSON.stringify(this.getFormData())
|
body: JSON.stringify(this.getFormData())
|
||||||
})
|
})
|
||||||
|
.then((response) => response.json())
|
||||||
|
.catch(function(error) {
|
||||||
|
this.setState({errors: error});
|
||||||
|
console.log('request failed', error);
|
||||||
|
}.bind(this));
|
||||||
|
|
||||||
|
//.then(FetchApiUtils.status)
|
||||||
|
|
||||||
},
|
},
|
||||||
getFormData() {
|
getFormData() {
|
||||||
return {
|
return {
|
||||||
|
@ -38,7 +38,6 @@ let EditionHeader = React.createClass({
|
|||||||
});
|
});
|
||||||
|
|
||||||
let EditionDetails = React.createClass({
|
let EditionDetails = React.createClass({
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<div className="ascribe-detail-header">
|
<div className="ascribe-detail-header">
|
||||||
|
@ -54,6 +54,13 @@ let FetchApiUtils = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return interpolation + orderBy;
|
return interpolation + orderBy;
|
||||||
|
},
|
||||||
|
|
||||||
|
status(response) {
|
||||||
|
if (response.status >= 200 && response.status < 300) {
|
||||||
|
return response
|
||||||
|
}
|
||||||
|
throw new Error(response.json())
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user