Fix account name validator and make sure the location CRUD works in the API for accounts.

This commit is contained in:
James Cole
2019-12-30 20:44:52 +01:00
parent 0ae52198e7
commit e1186b48ec
9 changed files with 170 additions and 52 deletions

View File

@@ -41,13 +41,16 @@ class Request extends FireflyIIIRequest
{
$active = true;
$includeNetWorth = true;
$hasLocation = false;
if (null !== $this->get('active')) {
$active = $this->boolean('active');
}
if (null !== $this->get('include_net_worth')) {
$includeNetWorth = $this->boolean('include_net_worth');
}
if ($this->has('longitude') && $this->has('latitude') && $this->has('zoom_level')) {
$hasLocation = true;
}
$data = [
'name' => $this->string('name'),
'active' => $active,
@@ -68,6 +71,10 @@ class Request extends FireflyIIIRequest
'notes' => $this->nlString('notes'),
'interest' => $this->string('interest'),
'interest_period' => $this->string('interest_period'),
'has_location' => $hasLocation,
'longitude' => $this->string('longitude'),
'latitude' => $this->string('latitude'),
'zoom_level' => $this->integer('zoom_level'),
];
if ('liability' === $data['account_type']) {