mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-11 07:10:48 +00:00
Fix two bugs in requests.
This commit is contained in:
@@ -30,8 +30,8 @@ class DateRangeRequest extends ApiRequest
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'start' => sprintf('date|after:1970-01-02|before:2038-01-17|before:end|required_with:end|', $this->required),
|
||||
'end' => sprintf('date|after:1970-01-02|before:2038-01-17|after:start|required_with:start|', $this->required),
|
||||
'start' => sprintf('date|after:1970-01-02|before:2038-01-17|before:end|required_with:end|%s', $this->required),
|
||||
'end' => sprintf('date|after:1970-01-02|before:2038-01-17|after:start|required_with:start|%s', $this->required),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -39,6 +39,8 @@ class DateRangeRequest extends ApiRequest
|
||||
{
|
||||
$validator->after(
|
||||
function (Validator $validator): void {
|
||||
$this->attributes->set('start', null);
|
||||
$this->attributes->set('end', null);
|
||||
if (!$validator->valid()) {
|
||||
return;
|
||||
}
|
||||
|
@@ -38,6 +38,7 @@ class DateRequest extends ApiRequest
|
||||
{
|
||||
$validator->after(
|
||||
function (Validator $validator): void {
|
||||
$this->attributes->set('date', null);
|
||||
if (!$validator->valid()) {
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user