mirror of
https://gitlab.com/MrFry/qmining-page
synced 2025-04-01 20:23:44 +02:00
Handling unexpected response on feedback page and parsing cid field
This commit is contained in:
parent
12027fb5d9
commit
e93c320ee3
1 changed files with 15 additions and 2 deletions
|
@ -71,6 +71,14 @@ export default function Feedback (props) {
|
|||
setResult(results.invalid)
|
||||
}
|
||||
|
||||
const t = document.getElementById('cid').value
|
||||
let cid = ''
|
||||
let version = ''
|
||||
if (t) {
|
||||
cid = t.split('|')[0]
|
||||
version = t.split('|')[1]
|
||||
}
|
||||
|
||||
const rawResponse = await fetch(constants.apiUrl + 'postfeedback', {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
|
@ -80,7 +88,8 @@ export default function Feedback (props) {
|
|||
},
|
||||
body: JSON.stringify({
|
||||
...form,
|
||||
cid: document.getElementById('cid').value
|
||||
cid: cid,
|
||||
version: version
|
||||
})
|
||||
})
|
||||
rawResponse.json()
|
||||
|
@ -249,7 +258,11 @@ export default function Feedback (props) {
|
|||
</div>
|
||||
)
|
||||
} else {
|
||||
console.log('else')
|
||||
return (
|
||||
<div className={styles.textTitle}>
|
||||
Bit of a fuckup here
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue