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

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)
parent 325b6e20
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -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}