summaryrefslogtreecommitdiff
path: root/lib/Travelynx/Controller/Api.pm
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2024-10-16 03:45:59 +0200
committerBirte Kristina Friesel <derf@finalrewind.org>2024-10-16 03:45:59 +0200
commitf89808826026c1f0e63f3a77afc802967a46bae4 (patch)
treee664ec16b71ad63507f8d461d7e1acbaec9c3f3d /lib/Travelynx/Controller/Api.pm
parent325b6e206d392266117103d45209c3bfc98ba2a4 (diff)
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)
Diffstat (limited to 'lib/Travelynx/Controller/Api.pm')
-rwxr-xr-xlib/Travelynx/Controller/Api.pm11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/Travelynx/Controller/Api.pm b/lib/Travelynx/Controller/Api.pm
index 5fbfb3e..0cc2c18 100755
--- a/lib/Travelynx/Controller/Api.pm
+++ b/lib/Travelynx/Controller/Api.pm
@@ -206,7 +206,9 @@ sub travel_v1 {
return;
}
- if ( not $hafas and not $self->stations->search($from_station, iris => 1) ) {
+ if ( not $hafas
+ and not $self->stations->search( $from_station, backend_id => 1 ) )
+ {
$self->render(
json => {
success => \0,
@@ -221,7 +223,7 @@ sub travel_v1 {
if ( $to_station
and not $hafas
- and not $self->stations->search($to_station, iris => 1) )
+ and not $self->stations->search( $to_station, backend_id => 1 ) )
{
$self->render(
json => {
@@ -528,8 +530,9 @@ sub import_v1 {
$payload->{toStation}{realTime}
// $payload->{toStation}{scheduledTime}
),
- comment => sanitize( q{}, $payload->{comment} ),
- lax => $payload->{lax} ? 1 : 0,
+ comment => sanitize( q{}, $payload->{comment} ),
+ lax => $payload->{lax} ? 1 : 0,
+ backend_id => 1,
);
if ( $payload->{intermediateStops}