[PLUGIN][WebHooks] Add hook for subscriptions

This commit is contained in:
2022-03-24 21:59:24 +00:00
committed by Diogo Peralta Cordeiro
parent e3e14c53ef
commit ca5520edbf
3 changed files with 43 additions and 17 deletions

View File

@@ -45,7 +45,7 @@ class WebHooks extends Controller
$hooks = F\reindex(DB::findBy(E\WebHook::class, ['actor_id' => $user->getId()]), fn (E\WebHook $wh) => $wh->getEvent());
$form = Form::create([
['notifications', TextType::class, ['label' => _m('Trigger this hook when I recieve a notification'), 'data' => ($hooks['notifications'] ?? null)?->getTarget()]],
['follow', TextType::class, ['label' => _m('Trigger this hook when someone starts following me'), 'data' => ($hooks['follow'] ?? null)?->getTarget()]],
['subscriptions', TextType::class, ['label' => _m('Trigger this hook when someone subscribes to me'), 'data' => ($hooks['subscriptions'] ?? null)?->getTarget()]],
['save_webhooks', SubmitType::class, ['label' => _m('Submit')]],
], form_options: ['action' => Router::url(P\WebHooks::controller_route)]);