mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-29 18:20:01 +00:00
No longer have to submit mandatory fields to account end point. Just submit the field you wish to update, the rest will be untouched.
This commit is contained in:
@@ -177,6 +177,37 @@ class Request extends FormRequest
|
||||
return (int)$string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return integer value, or NULL when it's not set.
|
||||
*
|
||||
* @param string $field
|
||||
*
|
||||
* @return int|null
|
||||
*/
|
||||
public function nullableInteger(string $field): ?int
|
||||
{
|
||||
$value = (string)$this->get($field);
|
||||
if ('' === $value) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (int)$value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return string value, or NULL if empty.
|
||||
*
|
||||
* @param string $field
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function nullableString(string $field): ?string
|
||||
{
|
||||
$string = app('steam')->cleanString((string)($this->get($field) ?? ''));
|
||||
|
||||
return '' === $string ? null : $string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return string value.
|
||||
*
|
||||
|
Reference in New Issue
Block a user