diff options
author | Daniel Friesel <derf@finalrewind.org> | 2022-02-20 17:35:30 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2022-02-20 17:35:30 +0100 |
commit | 209e2918217aef8d900a194309160f7119a205bc (patch) | |
tree | f108d9a4f02d217c57f8e9ef1412d34ec86e7b07 /lib/Travelynx/Controller | |
parent | 0d108e43343b055e1b6a77c78e4f91307f6964c0 (diff) |
Move webhook database queries to Users model
Diffstat (limited to 'lib/Travelynx/Controller')
-rw-r--r-- | lib/Travelynx/Controller/Account.pm | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/Travelynx/Controller/Account.pm b/lib/Travelynx/Controller/Account.pm index 88df2d5..0435d51 100644 --- a/lib/Travelynx/Controller/Account.pm +++ b/lib/Travelynx/Controller/Account.pm @@ -378,13 +378,16 @@ sub insight { sub webhook { my ($self) = @_; - my $hook = $self->get_webhook; + my $uid = $self->current_user->{id}; + + my $hook = $self->users->get_webhook( uid => $uid ); if ( $self->param('action') and $self->param('action') eq 'save' ) { $hook->{url} = $self->param('url'); $hook->{token} = $self->param('token'); $hook->{enabled} = $self->param('enabled') // 0; - $self->set_webhook( + $self->users->set_webhook( + uid => $uid, url => $hook->{url}, token => $hook->{token}, enabled => $hook->{enabled} @@ -395,7 +398,7 @@ sub webhook { sub { $self->render( 'webhooks', - hook => $self->get_webhook, + hook => $self->users->get_webhook( uid => $uid ), new_hook => 1 ); } |