mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-22 22:59:35 +02:00
fix product parsing 🐛
This commit is contained in:
parent
54f230bd44
commit
7b693950fc
1 changed files with 5 additions and 5 deletions
10
parse.js
10
parse.js
|
@ -35,15 +35,15 @@ const location = (l) => {
|
|||
|
||||
// todo: what is p.number vs p.line?
|
||||
// todo: what is p.icoX?
|
||||
// todo: what is p.cls?
|
||||
// todo: what is p.oprX?
|
||||
const product = (p) => {
|
||||
if (p.prodCtx) p = p.prodCtx
|
||||
if (!p) return null
|
||||
return {
|
||||
name: p.name, nr: +p.number, class: p.cls,
|
||||
productCode: +p.prodCtx.catCode, productName: p.prodCtx.catOutS
|
||||
const result = {line: p.line, class: p.cls}
|
||||
if (p.prodCtx) {
|
||||
result.productCode = +p.prodCtx.catCode
|
||||
result.productName = p.prodCtx.catOutS
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue