From 1efcc57770fd4501471339b361d90e17f202f0ec Mon Sep 17 00:00:00 2001 From: Martin Quarda Date: Mon, 7 Oct 2024 12:11:35 +0200 Subject: [PATCH] progress on progress --- frontend/src/scripts/index.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/frontend/src/scripts/index.js b/frontend/src/scripts/index.js index 67c6af6..f5da8bc 100644 --- a/frontend/src/scripts/index.js +++ b/frontend/src/scripts/index.js @@ -77,20 +77,20 @@ class Main extends Component { data: formData, onUploadProgress: ({loaded, total}) => this.setState({uploadProgress: loaded/total}) } - ).then(resp => resp.json()).then(json => { + ).then(({data}) => { this.setState({progress:false, uploadProgress: 1.0}); - if(json.reason){ + if(data.reason){ this.setState({ - text: json.reason, + text: data.reason, status: "failed", }) } else { this.setState({ - text: json.success, + text: data.success, status: "success", }) - if (json.redirect){ - window.open(json.redirect ,"_self") + if (data.redirect){ + window.open(data.redirect ,"_self") } } }); @@ -162,7 +162,7 @@ class Main extends Component {
this.onSubmit(e)}> - + progress: {this.state.uploadProgress}
} {this.state.page == "#payment" &&