mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-30 04:23:11 +03:00
Added active toggle to webhooks
To allow easy temporary de-activation without deletion or other workarounds. Updated tests to cover.
This commit is contained in:
@ -84,10 +84,13 @@ class ActivityLogger
|
||||
*/
|
||||
protected function dispatchWebhooks(string $type, $detail): void
|
||||
{
|
||||
$webhooks = Webhook::query()->whereHas('trackedEvents', function(Builder $query) use ($type) {
|
||||
$query->where('event', '=', $type)
|
||||
->orWhere('event', '=', 'all');
|
||||
})->get();
|
||||
$webhooks = Webhook::query()
|
||||
->whereHas('trackedEvents', function(Builder $query) use ($type) {
|
||||
$query->where('event', '=', $type)
|
||||
->orWhere('event', '=', 'all');
|
||||
})
|
||||
->where('active', '=', true)
|
||||
->get();
|
||||
|
||||
foreach ($webhooks as $webhook) {
|
||||
dispatch(new DispatchWebhookJob($webhook, $type, $detail));
|
||||
|
Reference in New Issue
Block a user