Add notification filters
This commit is contained in:
@@ -8,6 +8,10 @@ use Illuminate\Support\Arr;
|
||||
|
||||
class UpdateProjectNotificationAction
|
||||
{
|
||||
public function __construct(
|
||||
private readonly NormalizeNotificationFilters $normalizeNotificationFilters,
|
||||
) {}
|
||||
|
||||
/**
|
||||
* @param array{
|
||||
* channel?: mixed,
|
||||
@@ -15,6 +19,7 @@ class UpdateProjectNotificationAction
|
||||
* delivery_url?: string|null,
|
||||
* enabled?: bool,
|
||||
* event_type?: mixed,
|
||||
* filters?: mixed,
|
||||
* message_template?: string|null,
|
||||
* name?: string
|
||||
* } $validated
|
||||
@@ -54,6 +59,12 @@ class UpdateProjectNotificationAction
|
||||
);
|
||||
}
|
||||
|
||||
if (array_key_exists('filters', $validated)) {
|
||||
$attributes['filters'] = $this->normalizeNotificationFilters->handle(
|
||||
Arr::get($validated, 'filters'),
|
||||
);
|
||||
}
|
||||
|
||||
$deliveryUrl = Arr::get($validated, 'delivery_url');
|
||||
|
||||
if (is_string($deliveryUrl) && trim($deliveryUrl) !== '') {
|
||||
|
||||
Reference in New Issue
Block a user