Sending cid as part of form, which can be modified by external userscript

This commit is contained in:
MrFry 2020-03-31 10:16:39 +02:00
parent 35637615d6
commit 35263fccad

View file

@ -69,7 +69,6 @@ export default function Feedback (props) {
const handleSubmit = async () => {
if (!form.description) {
setResult(results.invalid)
return
}
const rawResponse = await fetch(constants.apiUrl + 'postfeedback', {
@ -78,7 +77,10 @@ export default function Feedback (props) {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify(form)
body: JSON.stringify({
...form,
cid: document.getElementById('cid').value
})
})
rawResponse.json()
.then((resp) => {
@ -194,8 +196,6 @@ export default function Feedback (props) {
type='text'
id='cid'
name='cid'
value={form.cid}
onChange={onChange}
hidden
/>
{renderResult()}