mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 07:09: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.number vs p.line?
|
||||||
// todo: what is p.icoX?
|
// todo: what is p.icoX?
|
||||||
// todo: what is p.cls?
|
|
||||||
// todo: what is p.oprX?
|
// todo: what is p.oprX?
|
||||||
const product = (p) => {
|
const product = (p) => {
|
||||||
if (p.prodCtx) p = p.prodCtx
|
|
||||||
if (!p) return null
|
if (!p) return null
|
||||||
return {
|
const result = {line: p.line, class: p.cls}
|
||||||
name: p.name, nr: +p.number, class: p.cls,
|
if (p.prodCtx) {
|
||||||
productCode: +p.prodCtx.catCode, productName: p.prodCtx.catOutS
|
result.productCode = +p.prodCtx.catCode
|
||||||
|
result.productName = p.prodCtx.catOutS
|
||||||
}
|
}
|
||||||
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue