mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2024-11-10 09:07:47 +01:00
Update src/routes/voteOnSponsorTime.js
Co-authored-by: Ajay Ramachandran <dev@ajay.app>
This commit is contained in:
parent
16c68dd51d
commit
fba25fea0f
1 changed files with 2 additions and 2 deletions
|
@ -98,7 +98,7 @@ async function voteOnSponsorTime(req, res) {
|
|||
let isVIP = db.prepare('get', "SELECT count(*) as userCount FROM vipUsers WHERE userID = ?", [nonAnonUserID]).userCount > 0;
|
||||
|
||||
//check if user voting on own submission
|
||||
let isOwnSubmission = !!db.prepare('all', 'SELECT UUID as submissionCount FROM sponsorTimes where userID = ? AND UUID = ?', [nonAnonUserID, UUID]).length;
|
||||
let isOwnSubmission = db.prepare("get", "SELECT UUID as submissionCount FROM sponsorTimes where userID = ? AND UUID = ?", [nonAnonUserID, UUID]) !== undefined;
|
||||
|
||||
if (type === undefined && category !== undefined) {
|
||||
return categoryVote(UUID, userID, isVIP, category, hashedIP, res);
|
||||
|
@ -314,4 +314,4 @@ module.exports = {
|
|||
endpoint: function (req, res) {
|
||||
voteOnSponsorTime(req, res);
|
||||
},
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue