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)
This commit is contained in:
Birte Kristina Friesel 2024-10-16 03:45:59 +02:00
parent 325b6e206d
commit f898088260
No known key found for this signature in database
GPG key ID: 19E6E524EBB177BA

View file

@ -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 => {
@ -530,6 +532,7 @@ sub import_v1 {
),
comment => sanitize( q{}, $payload->{comment} ),
lax => $payload->{lax} ? 1 : 0,
backend_id => 1,
);
if ( $payload->{intermediateStops}