From 820f2abe867cfe64137e39f0894e4c5ba4ab5d16 Mon Sep 17 00:00:00 2001 From: Jannis R Date: Mon, 27 May 2019 16:08:09 +0200 Subject: [PATCH] parseWarning: parse products --- parse/warning.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/parse/warning.js b/parse/warning.js index e697c8cf..f15c1c34 100644 --- a/parse/warning.js +++ b/parse/warning.js @@ -10,7 +10,8 @@ const typesByIcon = Object.assign(Object.create(null), { // todo: is passing in profile necessary? const parseWarning = (profile, w, icons) => { - // todo: hid, act, pub, lead, tckr, icoX, fLocX, tLocX, prod, comp, + // todo: pass `d`/`d.common` in, parse `w.fLocX`/`w.tLocX`/`w.icoX` + // todo: hid, act, pub, lead, tckr, comp, // todo: cat (1, 2), pubChL // pubChL: // [ { name: 'timetable', @@ -35,6 +36,7 @@ const parseWarning = (profile, w, icons) => { priority: w.prio, category: w.cat || null // todo: parse to sth meaningful } + if ('prod' in w) res.products = client.profile.parseProducts(61442) // todo: pass tzOffset to `parseDateTime` if (w.sDate && w.sTime) res.validFrom = parseDateTime(profile, w.sDate, w.sTime, null)