Loading route/setVote.js +4 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,10 @@ module.exports = function(app, sql, tokenCheck, errorHandler) { if (isNaN(vote)) return errorHandler(res, 400, 'Invalid vote'); if (vote < 0 || vote > 100) return errorHandler(res, 400, 'Vote must be between 0 and 100'); //TODO: check if player exists (tmio API check) //TODO: check if map exists (tmio API check) sql.query('SELECT * FROM votes WHERE map = ? AND player = ?', [mapId,player], (err, sqlRes)=>{ if (err) { console.log(err); Loading Loading
route/setVote.js +4 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,10 @@ module.exports = function(app, sql, tokenCheck, errorHandler) { if (isNaN(vote)) return errorHandler(res, 400, 'Invalid vote'); if (vote < 0 || vote > 100) return errorHandler(res, 400, 'Vote must be between 0 and 100'); //TODO: check if player exists (tmio API check) //TODO: check if map exists (tmio API check) sql.query('SELECT * FROM votes WHERE map = ? AND player = ?', [mapId,player], (err, sqlRes)=>{ if (err) { console.log(err); Loading