From 6f56f152847ecf3a91950bc85f7a254cfb608dac Mon Sep 17 00:00:00 2001 From: Tobias Roehr Date: Thu, 25 Mar 2021 12:39:00 +0100 Subject: [PATCH] Enable usage of 1st class BahnCards and fix typo --- p/db/loyalty-cards.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/p/db/loyalty-cards.js b/p/db/loyalty-cards.js index a4bdd719..ef884cee 100644 --- a/p/db/loyalty-cards.js +++ b/p/db/loyalty-cards.js @@ -2,7 +2,7 @@ // todo: generate from https://reiseauskunft.bahn.de/addons/fachkonfig-utf8.cfg ? const c = { - NONE: Symbol('no loyaly card'), + NONE: Symbol('no loyalty card'), BAHNCARD: Symbol('Bahncard'), VORTEILSCARD: Symbol('VorteilsCard'), HALBTAXABO: Symbol('HalbtaxAbo'), @@ -14,8 +14,8 @@ const c = { // see https://gist.github.com/juliuste/202bb04f450a79f8fa12a2ec3abcd72d const formatLoyaltyCard = (data) => { if (data.type === c.BAHNCARD) { - if (data.discount === 25) return c.class === 1 ? 1 : 2 - if (data.discount === 50) return c.class === 1 ? 3 : 4 + if (data.discount === 25) return data.class === 1 ? 1 : 2 + if (data.discount === 50) return data.class === 1 ? 3 : 4 } if (data.type === c.VORTEILSCARD) return 9 if (data.type === c.HALBTAXABO) return data.railplus ? 10 : 11