From 2f7bdf99e8b28f13bf44553b22b274f10627fa93 Mon Sep 17 00:00:00 2001
From: Daniel Friesel <daniel.friesel@uos.de>
Date: Thu, 10 Nov 2022 17:50:31 +0100
Subject: Traewelling: Use API v1 for checkin as well

---
 lib/Travelynx/Helper/Traewelling.pm | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/lib/Travelynx/Helper/Traewelling.pm b/lib/Travelynx/Helper/Traewelling.pm
index b713922..8794b6e 100644
--- a/lib/Travelynx/Helper/Traewelling.pm
+++ b/lib/Travelynx/Helper/Traewelling.pm
@@ -340,7 +340,7 @@ sub checkin {
 	}
 
 	my $request = {
-		tripID   => $opt{trip_id},
+		tripId   => $opt{trip_id},
 		lineName => $opt{train_type} . ' '
 		  . ( $opt{train_line} // $opt{train_no} ),
 		start       => q{} . $opt{dep_eva},
@@ -355,12 +355,13 @@ sub checkin {
 		$request->{body} = $opt{user_data}{comment};
 	}
 
+# https://github.com/Traewelling/traewelling/blob/develop/app/Http/Controllers/API/v1/TransportController.php -> create. trains/checkin ist richtig.
 	my $debug_prefix
-	  = "v0/trains/checkin('$request->{lineName}' $request->{tripID} $request->{start} -> $request->{destination})";
+	  = "v1/trains/checkin('$request->{lineName}' $request->{tripId} $request->{start} -> $request->{destination})";
 
 	$self->{user_agent}->request_timeout(20)
 	  ->post_p(
-		"https://traewelling.de/api/v0/trains/checkin" => $header => json =>
+		"https://traewelling.de/api/v1/trains/checkin" => $header => json =>
 		  $request )->then(
 		sub {
 			my ($tx) = @_;
-- 
cgit v1.2.3