From c6c70b66cd6c06aef1cf94e6723f5429297cea42 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Fri, 17 May 2024 18:58:11 +0200 Subject: Fix efa_url/service handling for new_p --- lib/Travel/Status/DE/EFA.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/Travel/Status/DE/EFA.pm b/lib/Travel/Status/DE/EFA.pm index b61acbc..b9ced2e 100644 --- a/lib/Travel/Status/DE/EFA.pm +++ b/lib/Travel/Status/DE/EFA.pm @@ -96,12 +96,12 @@ sub new_p { $self->{promise} = $opt{promise}; - $self->{ua}->post_p( $opt{efa_url} => form => $self->{post} )->then( + $self->{ua}->post_p( $self->{efa_url} => form => $self->{post} )->then( sub { my ($tx) = @_; if ( my $err = $tx->error ) { $promise->reject( -"POST $opt{efa_url} returned HTTP $err->{code} $err->{message}" +"POST $self->{efa_url} returned HTTP $err->{code} $err->{message}" ); return; } @@ -242,6 +242,8 @@ sub new { useRealtime => '1', }, developer_mode => $opt{developer_mode}, + efa_url => $opt{efa_url}, + service => $opt{service}, }; if ( $opt{place} ) { @@ -271,7 +273,7 @@ sub new { return $self; } - my $response = $self->{ua}->post( $opt{efa_url}, $self->{post} ); + my $response = $self->{ua}->post( $self->{efa_url}, $self->{post} ); if ( $response->is_error ) { $self->{errstr} = $response->status_line; -- cgit v1.2.3