mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-05-04 21:23:36 +00:00
🤖 Auto commit for release 'develop' on 2026-01-23
This commit is contained in:
@@ -44,19 +44,19 @@ class UpdateRequest extends FormRequest
|
||||
|
||||
public function getData(): array
|
||||
{
|
||||
$fields = ['title' => ['title', 'convertString'], 'active' => ['active', 'boolean'], 'url' => ['url', 'convertString']];
|
||||
$fields = ['title' => ['title', 'convertString'], 'active' => ['active', 'boolean'], 'url' => ['url', 'convertString']];
|
||||
|
||||
$triggers = $this->get('triggers', []);
|
||||
$responses = $this->get('responses', []);
|
||||
$deliveries = $this->get('deliveries', []);
|
||||
$triggers = $this->get('triggers', []);
|
||||
$responses = $this->get('responses', []);
|
||||
$deliveries = $this->get('deliveries', []);
|
||||
|
||||
if (in_array(0, [count($triggers), count($responses), count($deliveries)], true)) {
|
||||
throw new FireflyException('Unexpectedly got no responses, triggers or deliveries.');
|
||||
}
|
||||
|
||||
$return = $this->getAllData($fields);
|
||||
$return['triggers'] = $triggers;
|
||||
$return['responses'] = $responses;
|
||||
$return = $this->getAllData($fields);
|
||||
$return['triggers'] = $triggers;
|
||||
$return['responses'] = $responses;
|
||||
$return['deliveries'] = $deliveries;
|
||||
|
||||
return $return;
|
||||
@@ -73,10 +73,10 @@ class UpdateRequest extends FormRequest
|
||||
$validProtocols = FireflyConfig::get('valid_url_protocols', config('firefly.valid_url_protocols'))->data;
|
||||
|
||||
/** @var Webhook $webhook */
|
||||
$webhook = $this->route()->parameter('webhook');
|
||||
$webhook = $this->route()->parameter('webhook');
|
||||
|
||||
return ['title' => sprintf('min:1|max:255|uniqueObjectForUser:webhooks,title,%d', $webhook->id), 'active' => [new IsBoolean()],
|
||||
return ['title' => sprintf('min:1|max:255|uniqueObjectForUser:webhooks,title,%d', $webhook->id), 'active' => [new IsBoolean()],
|
||||
'trigger' => 'prohibited', 'triggers' => 'required|array|min:1|max:10', 'triggers.*' => sprintf('required|in:%s', $triggers), 'response' => 'prohibited', 'responses' => 'required|array|min:1|max:1', 'responses.*' => sprintf('required|in:%s', $responses), 'delivery' => 'prohibited', 'deliveries' => 'required|array|min:1|max:1', 'deliveries.*' => sprintf('required|in:%s', $deliveries),
|
||||
'url' => [sprintf('url:%s', $validProtocols), sprintf('uniqueExistingWebhook:%d', $webhook->id)]];
|
||||
'url' => [sprintf('url:%s', $validProtocols), sprintf('uniqueExistingWebhook:%d', $webhook->id)]];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user