summaryrefslogtreecommitdiff
path: root/lib/Travelynx/Controller/Api.pm
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2020-08-16 21:20:23 +0200
committerDaniel Friesel <derf@finalrewind.org>2020-08-16 21:20:23 +0200
commit47b957361e84c826bfee0fa4e45db9de9e5c0182 (patch)
tree1ae4234091fbb321df7dafea395d962963ca2d96 /lib/Travelynx/Controller/Api.pm
parentd9624ee30882a66e5304a2cca0591a77fc9445f1 (diff)
Move most journey code to newly introduced Journey model
Diffstat (limited to 'lib/Travelynx/Controller/Api.pm')
-rwxr-xr-xlib/Travelynx/Controller/Api.pm12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/Travelynx/Controller/Api.pm b/lib/Travelynx/Controller/Api.pm
index 8af57be..6ffd310 100755
--- a/lib/Travelynx/Controller/Api.pm
+++ b/lib/Travelynx/Controller/Api.pm
@@ -492,18 +492,18 @@ sub import_v1 {
my $tx = $db->begin;
$opt{db} = $db;
- my ( $journey_id, $error ) = $self->add_journey(%opt);
+ my ( $journey_id, $error ) = $self->journeys->add(%opt);
my $journey;
if ( not $error ) {
- $journey = $self->get_journey(
+ $journey = $self->journeys->get_single(
uid => $uid,
db => $db,
journey_id => $journey_id,
verbose => 1
);
$error
- = $self->journey_sanity_check( $journey, $payload->{lax} ? 1 : 0 );
+ = $self->journeys->sanity_check( $journey, $payload->{lax} ? 1 : 0 );
}
if ($error) {
@@ -526,7 +526,11 @@ sub import_v1 {
);
}
else {
- $self->invalidate_stats_cache( $opt{rt_departure}, $db, $uid );
+ $self->journeys->invalidate_stats_cache(
+ ts => $opt{rt_departure},
+ db => $db,
+ uid => $uid
+ );
$tx->commit;
$self->render(
json => {