summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDerf Null <derf@finalrewind.org>2023-06-28 22:21:51 +0200
committerDerf Null <derf@finalrewind.org>2023-06-28 22:21:51 +0200
commit00ee3de6c1fef9df7c999eaefbe3508d59b79f8b (patch)
tree7bffd817df8d5cb78f81bf77faf044ef36541e41 /lib
parentc7fedb9e42164f98a3f907a738f3141d396f2868 (diff)
Journey->add_from_in_transit: return ID of added journey
Diffstat (limited to 'lib')
-rwxr-xr-xlib/Travelynx/Model/Journeys.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Travelynx/Model/Journeys.pm b/lib/Travelynx/Model/Journeys.pm
index 6884ae7..b15507f 100755
--- a/lib/Travelynx/Model/Journeys.pm
+++ b/lib/Travelynx/Model/Journeys.pm
@@ -254,7 +254,8 @@ sub add_from_in_transit {
$journey->{edited} = 0;
$journey->{checkout_time} = DateTime->now( time_zone => 'Europe/Berlin' );
- $db->insert( 'journeys', $journey );
+ return $db->insert( 'journeys', $journey, { returning => 'id' } )
+ ->hash->{id};
}
sub update {