Unverified Commit 0c5908e7 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

manual journey entry: hardcode DB (HAFAS) for station selection

TODO: Add a dropdown to select different backends

Closes #150
parent aec37cce
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -2116,6 +2116,7 @@ sub add_journey_form {

		$opt{db}         = $db;
		$opt{uid}        = $self->current_user->{id};
		$opt{backend_id} = 1;

		my ( $journey_id, $error ) = $self->journeys->add(%opt);

+4 −2
Original line number Diff line number Diff line
@@ -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' );