This commit is contained in:
parent
ac8de54d95
commit
561fbf0a75
|
@ -201,7 +201,23 @@ climbingRoutesRouter.post('/', async (req: Request, res: Response) => {
|
||||||
let captcha_token = req.query['hcaptcha_response'] as string;
|
let captcha_token = req.query['hcaptcha_response'] as string;
|
||||||
|
|
||||||
if (isNaN(gym_id) || !name || !difficulty || !captcha_token) {
|
if (isNaN(gym_id) || !name || !difficulty || !captcha_token) {
|
||||||
res.status(400).send({'message': 'Missing parameters'});
|
let missing = '';
|
||||||
|
if (isNaN(gym_id)) {
|
||||||
|
missing += 'gym_id;';
|
||||||
|
} else if (!name) {
|
||||||
|
missing += 'name;';
|
||||||
|
} else if (!difficulty) {
|
||||||
|
missing += 'difficulty;';
|
||||||
|
} else if (!captcha_token) {
|
||||||
|
missing += 'token;';
|
||||||
|
} else {
|
||||||
|
missing += 'all good';
|
||||||
|
}
|
||||||
|
|
||||||
|
res.status(400).send({
|
||||||
|
'message': 'Missing parameters',
|
||||||
|
'missing': missing
|
||||||
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user