Merge pull request #8 from ajayyy/experimental

Fixed NaN check not correct
This commit is contained in:
Ajay Ramachandran
2019-07-28 16:06:00 -04:00
committed by GitHub

View File

@@ -109,7 +109,7 @@ app.get('/api/postVideoSponsorTimes', function (req, res) {
startTime = parseFloat(startTime);
endTime = parseFloat(endTime);
if (startTime == NaN || endTime == NaN) {
if (isNaN(startTime) || isNaN(endTime)) {
//invalid request
res.sendStatus(400);
return;
@@ -224,8 +224,6 @@ app.get('/api/voteOnSponsorTime', function (req, res) {
//oldIncrementAmount will be zero is row is null
db.prepare("UPDATE sponsorTimes SET votes = votes + ? WHERE UUID = ?").run(incrementAmount - oldIncrementAmount, UUID);
//update the votes table
//added to db
res.sendStatus(200);
});