mirror of
https://github.com/derf/travelynx
synced 2024-11-10 06:54:17 +00:00
manual journey entry: hardcode DB (HAFAS) for station selection
TODO: Add a dropdown to select different backends Closes #150
This commit is contained in:
parent
aec37cce68
commit
0c5908e722
2 changed files with 7 additions and 4 deletions
|
@ -2114,8 +2114,9 @@ sub add_journey_form {
|
|||
my $db = $self->pg->db;
|
||||
my $tx = $db->begin;
|
||||
|
||||
$opt{db} = $db;
|
||||
$opt{uid} = $self->current_user->{id};
|
||||
$opt{db} = $db;
|
||||
$opt{uid} = $self->current_user->{id};
|
||||
$opt{backend_id} = 1;
|
||||
|
||||
my ( $journey_id, $error ) = $self->journeys->add(%opt);
|
||||
|
||||
|
|
|
@ -118,8 +118,10 @@ sub add {
|
|||
my $db = $opt{db};
|
||||
my $uid = $opt{uid};
|
||||
my $now = DateTime->now( time_zone => 'Europe/Berlin' );
|
||||
my $dep_station = $self->{stations}->search( $opt{dep_station} );
|
||||
my $arr_station = $self->{stations}->search( $opt{arr_station} );
|
||||
my $dep_station = $self->{stations}
|
||||
->search( $opt{dep_station}, backend_id => $opt{backend_id} );
|
||||
my $arr_station = $self->{stations}
|
||||
->search( $opt{arr_station}, backend_id => $opt{backend_id} );
|
||||
|
||||
if ( not $dep_station ) {
|
||||
return ( undef, 'Unbekannter Startbahnhof' );
|
||||
|
|
Loading…
Reference in a new issue