From 35263fccad68f2b8a564532658a5489c92674675 Mon Sep 17 00:00:00 2001 From: MrFry Date: Tue, 31 Mar 2020 10:16:39 +0200 Subject: [PATCH] Sending cid as part of form, which can be modified by external userscript --- src/pages/feedback.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pages/feedback.js b/src/pages/feedback.js index a5acbca..b49ab40 100644 --- a/src/pages/feedback.js +++ b/src/pages/feedback.js @@ -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()}