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:
@@ -71,6 +71,14 @@ export default function Feedback (props) {
|
|||||||
setResult(results.invalid)
|
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', {
|
const rawResponse = await fetch(constants.apiUrl + 'postfeedback', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
credentials: 'include',
|
credentials: 'include',
|
||||||
@@ -80,7 +88,8 @@ export default function Feedback (props) {
|
|||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
...form,
|
...form,
|
||||||
cid: document.getElementById('cid').value
|
cid: cid,
|
||||||
|
version: version
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
rawResponse.json()
|
rawResponse.json()
|
||||||
@@ -249,7 +258,11 @@ export default function Feedback (props) {
|
|||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
console.log('else')
|
return (
|
||||||
|
<div className={styles.textTitle}>
|
||||||
|
Bit of a fuckup here
|
||||||
|
</div>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user