Skip to content

Commit f898088

Browse files
committed
api/v1/import: hard-code backend_id to 1 (same as import form)
Closes #162 See also #170 (thanks to https://github.com/homologic for the suggestion)
1 parent 325b6e2 commit f898088

File tree

1 file changed

+7
-4
lines changed
  • lib/Travelynx/Controller

1 file changed

+7
-4
lines changed

lib/Travelynx/Controller/Api.pm

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,9 @@ sub travel_v1 {
206206
return;
207207
}
208208

209-
if ( not $hafas and not $self->stations->search($from_station, iris => 1) ) {
209+
if ( not $hafas
210+
and not $self->stations->search( $from_station, backend_id => 1 ) )
211+
{
210212
$self->render(
211213
json => {
212214
success => \0,
@@ -221,7 +223,7 @@ sub travel_v1 {
221223

222224
if ( $to_station
223225
and not $hafas
224-
and not $self->stations->search($to_station, iris => 1) )
226+
and not $self->stations->search( $to_station, backend_id => 1 ) )
225227
{
226228
$self->render(
227229
json => {
@@ -528,8 +530,9 @@ sub import_v1 {
528530
$payload->{toStation}{realTime}
529531
// $payload->{toStation}{scheduledTime}
530532
),
531-
comment => sanitize( q{}, $payload->{comment} ),
532-
lax => $payload->{lax} ? 1 : 0,
533+
comment => sanitize( q{}, $payload->{comment} ),
534+
lax => $payload->{lax} ? 1 : 0,
535+
backend_id => 1,
533536
);
534537

535538
if ( $payload->{intermediateStops}

0 commit comments

Comments
 (0)