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