Merge remote-tracking branch 'github/main'
This commit is contained in:
commit
fc2aa95656
2 changed files with 21 additions and 14 deletions
2
.github/workflows/perl.yml
vendored
2
.github/workflows/perl.yml
vendored
|
@ -13,7 +13,7 @@ jobs:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
perl-version:
|
perl-version:
|
||||||
- '5.20-buster'
|
- '5.30-buster'
|
||||||
- 'latest'
|
- 'latest'
|
||||||
- 'threaded'
|
- 'threaded'
|
||||||
|
|
||||||
|
|
|
@ -182,7 +182,7 @@ sub travel_v1 {
|
||||||
my $from_station = sanitize( q{}, $payload->{fromStation} );
|
my $from_station = sanitize( q{}, $payload->{fromStation} );
|
||||||
my $to_station = sanitize( q{}, $payload->{toStation} );
|
my $to_station = sanitize( q{}, $payload->{toStation} );
|
||||||
my $train_id;
|
my $train_id;
|
||||||
my $hafas = sanitize(undef, $payload->{hafas});
|
my $hafas = sanitize( undef, $payload->{hafas} );
|
||||||
$hafas //= exists $payload->{train}{journeyID} ? 'DB' : undef;
|
$hafas //= exists $payload->{train}{journeyID} ? 'DB' : undef;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
@ -201,7 +201,7 @@ sub travel_v1 {
|
||||||
error => 'Missing fromStation or train data',
|
error => 'Missing fromStation or train data',
|
||||||
status => $self->get_user_status_json_v1( uid => $uid )
|
status => $self->get_user_status_json_v1( uid => $uid )
|
||||||
},
|
},
|
||||||
status => 400,
|
status => 400,
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -216,7 +216,7 @@ sub travel_v1 {
|
||||||
error => 'Unknown fromStation',
|
error => 'Unknown fromStation',
|
||||||
status => $self->get_user_status_json_v1( uid => $uid )
|
status => $self->get_user_status_json_v1( uid => $uid )
|
||||||
},
|
},
|
||||||
status => 400,
|
status => 400,
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -232,7 +232,7 @@ sub travel_v1 {
|
||||||
error => 'Unknown toStation',
|
error => 'Unknown toStation',
|
||||||
status => $self->get_user_status_json_v1( uid => $uid )
|
status => $self->get_user_status_json_v1( uid => $uid )
|
||||||
},
|
},
|
||||||
status => 400,
|
status => 400,
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -571,14 +571,20 @@ sub import_v1 {
|
||||||
my $journey;
|
my $journey;
|
||||||
|
|
||||||
if ( not $error ) {
|
if ( not $error ) {
|
||||||
$journey = $self->journeys->get_single(
|
eval {
|
||||||
uid => $uid,
|
$journey = $self->journeys->get_single(
|
||||||
db => $db,
|
uid => $uid,
|
||||||
journey_id => $journey_id,
|
db => $db,
|
||||||
verbose => 1
|
journey_id => $journey_id,
|
||||||
);
|
verbose => 1
|
||||||
$error
|
);
|
||||||
= $self->journeys->sanity_check( $journey, $payload->{lax} ? 1 : 0 );
|
$error
|
||||||
|
= $self->journeys->sanity_check( $journey,
|
||||||
|
$payload->{lax} ? 1 : 0 );
|
||||||
|
};
|
||||||
|
if ($@) {
|
||||||
|
$error = $@;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($error) {
|
if ($error) {
|
||||||
|
@ -673,7 +679,8 @@ sub autocomplete {
|
||||||
= "document.addEventListener('DOMContentLoaded',function(){M.Autocomplete.init(document.querySelectorAll('.autocomplete'),{\n";
|
= "document.addEventListener('DOMContentLoaded',function(){M.Autocomplete.init(document.querySelectorAll('.autocomplete'),{\n";
|
||||||
$output .= 'minLength:3,limit:50,data:';
|
$output .= 'minLength:3,limit:50,data:';
|
||||||
$output
|
$output
|
||||||
.= encode_json( $self->stations->get_for_autocomplete( backend_id => $backend_id ) );
|
.= encode_json(
|
||||||
|
$self->stations->get_for_autocomplete( backend_id => $backend_id ) );
|
||||||
$output .= "\n});});\n";
|
$output .= "\n});});\n";
|
||||||
|
|
||||||
$self->render(
|
$self->render(
|
||||||
|
|
Loading…
Reference in a new issue