From 00ee3de6c1fef9df7c999eaefbe3508d59b79f8b Mon Sep 17 00:00:00 2001 From: Derf Null Date: Wed, 28 Jun 2023 22:21:51 +0200 Subject: Journey->add_from_in_transit: return ID of added journey --- lib/Travelynx/Model/Journeys.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/Travelynx') 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 { -- cgit v1.2.3