From b85db3a10df32cb2648607c83d37160ac3ee8691 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Tue, 14 May 2019 20:05:45 +0200 Subject: Show web-hook test result immediately after saving it Closes #12 --- lib/Travelynx/Controller/Account.pm | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'lib/Travelynx/Controller') diff --git a/lib/Travelynx/Controller/Account.pm b/lib/Travelynx/Controller/Account.pm index e272eb1..e2bfd39 100644 --- a/lib/Travelynx/Controller/Account.pm +++ b/lib/Travelynx/Controller/Account.pm @@ -246,9 +246,18 @@ sub webhook { token => $hook->{token}, enabled => $hook->{enabled} ); - $self->flash( success => 'webhook' ); - $self->redirect_to('account'); - $self->run_hook( $self->current_user->{id}, 'ping' ); + $self->run_hook( + $self->current_user->{id}, + 'ping', + sub { + $self->render( + 'webhooks', + hook => $self->get_webhook, + new_hook => 1 + ); + } + ); + return; } else { $self->param( url => $hook->{url} ); -- cgit v1.2.3