mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 07:09:35 +02:00
parseWarning: use fromLocations[0]
This commit is contained in:
parent
472646057f
commit
fe63644827
1 changed files with 4 additions and 4 deletions
|
@ -15,16 +15,16 @@ const parseMsgEdge = (ctx) => (e) => {
|
|||
])
|
||||
res.icon = e.icon || null
|
||||
// todo: rename `Loc` -> `Location` [breaking]
|
||||
res.fromLoc = e.fromLocation || null
|
||||
res.toLoc = e.toLocation || null
|
||||
res.fromLoc = Array.isArray(e.fromLocations) && e.fromLocations[0] || e.fromLocation || null
|
||||
res.toLoc = Array.isArray(e.toLocations) && e.toLocations[0] || e.toLocation || null
|
||||
return res
|
||||
}
|
||||
const parseMsgEvent = (ctx) => (e) => {
|
||||
const {profile} = ctx // todo: test that covers this
|
||||
return {
|
||||
// todo: rename `Loc` -> `Location` [breaking]
|
||||
fromLoc: e.fromLocation || null,
|
||||
toLoc: e.toLocation || null,
|
||||
fromLoc: Array.isArray(e.fromLocations) && e.fromLocations[0] || e.fromLocation || null,
|
||||
toLoc: Array.isArray(e.toLocations) && e.toLocations[0] || e.toLocation || null,
|
||||
start: profile.parseDateTime(ctx, e.fDate, e.fTime, null),
|
||||
end: profile.parseDateTime(ctx, e.tDate, e.tTime, null),
|
||||
sections: e.sectionNums || [] // todo: parse
|
||||
|
|
Loading…
Add table
Reference in a new issue