@@ -2,6 +2,7 @@ import express, {Request, Response} from 'express';
|
||||
import * as RatingService from './routeRatings.service';
|
||||
import {Guid} from 'guid-typescript';
|
||||
import logger from '../../../middleware/logger';
|
||||
import {verifyCaptcha} from '../common/VerifyCaptcha';
|
||||
|
||||
export const routeRatingsRouter = express.Router();
|
||||
|
||||
@@ -27,7 +28,7 @@ routeRatingsRouter.post('/', async (req: Request, res: Response) => {
|
||||
try {
|
||||
let route_id = req.query.route_id as string;
|
||||
let stars = Number(req.query.stars);
|
||||
let captcha_token = req.query.captcha_token as string;
|
||||
let captcha_token = req.query['h-captcha-response'] as string;
|
||||
|
||||
if (!route_id || isNaN(stars) || !captcha_token) {
|
||||
console.log(route_id, stars, captcha_token);
|
||||
@@ -36,10 +37,10 @@ routeRatingsRouter.post('/', async (req: Request, res: Response) => {
|
||||
}
|
||||
|
||||
// Verify captcha
|
||||
/*if (!await verifyCaptcha(captcha_token)) {
|
||||
if (!await verifyCaptcha(captcha_token)) {
|
||||
res.status(403).send({'message': 'Invalid Captcha. Please try again.'});
|
||||
return;
|
||||
}*/
|
||||
}
|
||||
|
||||
let result = await RatingService.createRating(route_id, stars);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user