File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -4,12 +4,12 @@ import type Pulsar from "pulsar-client";
44import type * as expandedApc from "./quicktype/expandedApc" ;
55import { passengerCount } from "./protobuf/passengerCount" ;
66
7- export const getUniqueVehicleIdFromMqttTopic = (
7+ export const getVehicleModeAndUniqueVehicleIdFromMqttTopic = (
88 topic : string ,
99) : string | undefined => {
1010 const parts = topic . split ( "/" ) ;
1111 if ( parts . length >= 9 ) {
12- return parts . slice ( 7 , 9 ) . join ( "/" ) ;
12+ return parts . slice ( 6 , 9 ) . join ( "/" ) ;
1313 }
1414 return undefined ;
1515} ;
@@ -149,7 +149,9 @@ export const initializeTransformer = (
149149 "APC data is missing topic and thus the owning operator and its vehicle number" ,
150150 ) ;
151151 } else {
152- const mqttTopicSuffix = getUniqueVehicleIdFromMqttTopic ( apcData . topic ) ;
152+ const mqttTopicSuffix = getVehicleModeAndUniqueVehicleIdFromMqttTopic (
153+ apcData . topic ,
154+ ) ;
153155 if ( mqttTopicSuffix === undefined ) {
154156 logger . warn (
155157 { topic : apcData . topic } ,
You can’t perform that action at this time.
0 commit comments