diff options
author | Birte Kristina Friesel <derf@finalrewind.org> | 2024-05-17 18:58:11 +0200 |
---|---|---|
committer | Birte Kristina Friesel <derf@finalrewind.org> | 2024-05-17 18:58:11 +0200 |
commit | c6c70b66cd6c06aef1cf94e6723f5429297cea42 (patch) | |
tree | c8b8fe9549a87e60fa639f589a3962b3f434ccb2 | |
parent | dfa79f5313d09c3e98f5b7e452e54aa77efd518a (diff) |
Fix efa_url/service handling for new_p
-rw-r--r-- | lib/Travel/Status/DE/EFA.pm | 8 |
1 files 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; |