journey->add: pass backend_id on to station search for route

Ref: #150
This commit is contained in:
Birte Kristina Friesel 2024-08-04 20:41:25 +02:00
parent 0c5908e722
commit 1bb348ad9a
No known key found for this signature in database
GPG key ID: 19E6E524EBB177BA

View file

@ -185,7 +185,8 @@ sub add {
if ( $opt{route} ) { if ( $opt{route} ) {
my @unknown_stations; my @unknown_stations;
for my $station ( @{ $opt{route} } ) { for my $station ( @{ $opt{route} } ) {
my $station_info = $self->{stations}->search($station); my $station_info = $self->{stations}
->search( $station, backend_id => $opt{backend_id} );
if ($station_info) { if ($station_info) {
push( push(
@route, @route,
@ -249,7 +250,7 @@ sub add {
edited => 0x3fff, edited => 0x3fff,
cancelled => $opt{cancelled} ? 1 : 0, cancelled => $opt{cancelled} ? 1 : 0,
route => JSON->new->encode( \@route ), route => JSON->new->encode( \@route ),
backend_id => 1, backend_id => $opt{backend_id},
}; };
if ( $opt{comment} ) { if ( $opt{comment} ) {