From 448294ba5c4ff587465a2a9fa3c9eabec0c43812 Mon Sep 17 00:00:00 2001 From: "jannes.t13@gmail.com" Date: Thu, 23 Mar 2023 19:44:02 +0100 Subject: [PATCH] add travellers age parameter Co-Authored-By: Jannis R --- api.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/api.js b/api.js index 30f874a..4c0a103 100644 --- a/api.js +++ b/api.js @@ -12,7 +12,7 @@ import Redis from 'ioredis' import {createCachedHafasClient} from 'cached-hafas-client' import {createRedisStore} from 'cached-hafas-client/stores/redis.js' import serveStatic from 'serve-static' -import {parseBoolean} from 'hafas-rest-api/lib/parse.js' +import {parseBoolean, parseInteger} from 'hafas-rest-api/lib/parse.js' import {loyaltyCardParser} from './lib/loyalty-cards.js' import {route as stations} from './routes/stations.js' import {route as station} from './routes/station.js' @@ -60,6 +60,12 @@ const mapRouteParsers = (route, parsers) => { default: 'false', parse: parseBoolean, }, + age: { + description: 'Age of traveller', + type: 'integer', + defaultStr: '*adult*', + parse: parseInteger + }, } }