mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-16 08:26:59 +03:00
migrate to typescript
This commit is contained in:
committed by
Dainius Dauksevicius
parent
c462323dd5
commit
08d27265fc
16
src/routes/viewedVideoSponsorTime.ts
Normal file
16
src/routes/viewedVideoSponsorTime.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import {db} from '../databases/databases';
|
||||
import {Request, Response} from 'express';
|
||||
|
||||
export function viewedVideoSponsorTime(req: Request, res: Response): Response {
|
||||
let UUID = req.query.UUID;
|
||||
|
||||
if (UUID == undefined) {
|
||||
//invalid request
|
||||
return res.sendStatus(400);
|
||||
}
|
||||
|
||||
//up the view count by one
|
||||
db.prepare('run', "UPDATE sponsorTimes SET views = views + 1 WHERE UUID = ?", [UUID]);
|
||||
|
||||
return res.sendStatus(200);
|
||||
}
|
||||
Reference in New Issue
Block a user