diff options
author | Derf Null <derf@finalrewind.org> | 2023-06-28 22:21:51 +0200 |
---|---|---|
committer | Derf Null <derf@finalrewind.org> | 2023-06-28 22:21:51 +0200 |
commit | 00ee3de6c1fef9df7c999eaefbe3508d59b79f8b (patch) | |
tree | 7bffd817df8d5cb78f81bf77faf044ef36541e41 /lib | |
parent | c7fedb9e42164f98a3f907a738f3141d396f2868 (diff) |
Journey->add_from_in_transit: return ID of added journey
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/Travelynx/Model/Journeys.pm | 3 |
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 { |