From b80613b8a8dad252960d90f6a03227503e2ba133 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Tue, 19 Nov 2019 19:46:21 +0100 Subject: allow route input when adding journeys manually (#26) --- lib/Travelynx/Controller/Traveling.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/Travelynx/Controller') diff --git a/lib/Travelynx/Controller/Traveling.pm b/lib/Travelynx/Controller/Traveling.pm index f0f1879..c8f975f 100755 --- a/lib/Travelynx/Controller/Traveling.pm +++ b/lib/Travelynx/Controller/Traveling.pm @@ -803,10 +803,14 @@ sub add_journey_form { $opt{rt_departure} //= $opt{sched_departure}; $opt{rt_arrival} //= $opt{sched_arrival}; - for my $key (qw(dep_station arr_station cancelled comment)) { + for my $key (qw(dep_station arr_station route cancelled comment)) { $opt{$key} = $self->param($key); } + if ( $opt{route} ) { + $opt{route} = [ split( qr{\r?\n\r?}, $opt{route} ) ]; + } + my $db = $self->pg->db; my $tx = $db->begin; -- cgit v1.2.3