mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
This commit is contained in:
parent
ddabfbc1ad
commit
d7e6a7b125
@ -145,11 +145,11 @@ class TriggerController extends Controller
|
|||||||
// add a range:
|
// add a range:
|
||||||
$ruleEngine->addOperator(['type' => 'date_before', 'value' => $parameters['end']->format('Y-m-d')]);
|
$ruleEngine->addOperator(['type' => 'date_before', 'value' => $parameters['end']->format('Y-m-d')]);
|
||||||
}
|
}
|
||||||
if (array_key_exists('accounts', $parameters) && '' !== $parameters['accounts']) {
|
if (array_key_exists('accounts', $parameters) && is_array($parameters['accounts']) && count($parameters['accounts']) > 0) {
|
||||||
$ruleEngine->addOperator(['type' => 'account_id', 'value' => implode(',', $parameters['accounts'])]);
|
$ruleEngine->addOperator(['type' => 'account_id', 'value' => implode(',', $parameters['accounts'])]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// file the rule(s)
|
// fire the rule(s)
|
||||||
$ruleEngine->fire();
|
$ruleEngine->fire();
|
||||||
|
|
||||||
return response()->json([], 204);
|
return response()->json([], 204);
|
||||||
|
@ -55,7 +55,7 @@ class TriggerRequest extends FormRequest
|
|||||||
*/
|
*/
|
||||||
private function getDate(string $field): ?Carbon
|
private function getDate(string $field): ?Carbon
|
||||||
{
|
{
|
||||||
return null === $this->query($field) ? null : Carbon::createFromFormat('Y-m-d', $this->query($field));
|
return null === $this->query($field) ? null : Carbon::createFromFormat('Y-m-d', substr($this->query($field),0,10));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -63,7 +63,7 @@ class TriggerRequest extends FormRequest
|
|||||||
*/
|
*/
|
||||||
private function getAccounts(): array
|
private function getAccounts(): array
|
||||||
{
|
{
|
||||||
return $this->get('accounts');
|
return $this->get('accounts') ?? [];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user