diff options
author | LarsVomMars | 2021-01-29 11:31:24 +0100 |
---|---|---|
committer | LarsVomMars | 2021-01-29 11:31:24 +0100 |
commit | 5eb14d6d09638c9ba3f034a019a8cd54c512b238 (patch) | |
tree | 5031371019c62054aabccc79ccc24561d85c9998 /profile/index.js | |
parent | dcf2ba4afc2eec720d6ae6df4be1b290cc91563c (diff) |
Some fixes
Diffstat (limited to 'profile/index.js')
-rw-r--r-- | profile/index.js | 6 |
1 files changed, 3 insertions, 3 deletions
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); } |