From 5eb14d6d09638c9ba3f034a019a8cd54c512b238 Mon Sep 17 00:00:00 2001 From: LarsVomMars Date: Fri, 29 Jan 2021 11:31:24 +0100 Subject: Some fixes --- profile/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'profile/index.js') diff --git a/profile/index.js b/profile/index.js index 41de0d5..cc0972a 100644 --- a/profile/index.js +++ b/profile/index.js @@ -47,11 +47,11 @@ app.put("/api/answer", async (req, res) => { async function answer(req, res, qs) { try { - for (const qid of req.body) { - if (!req.body.hasOwnProperty(qid)/* || !req.body[qid]*/) continue; + for (const qid in req.body) { + if (!req.body.hasOwnProperty(qid)) continue; const answer = req.body[qid]; try { - await db.query(qs, [answer, qid, req.session.uid]); // TODO: Frontend display sanitize + await db.query(qs, [answer, qid, req.session.uid]); } catch (e) { console.error(e); } -- cgit v1.2.3