From 8395800aedf66ea70222eb6fba7e346778849d98 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Mon, 5 Oct 2020 19:31:28 +0200 Subject: [PATCH] Improve settings and settings tests --- Controller/ApiController.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Controller/ApiController.php b/Controller/ApiController.php index fcc43af..e69a779 100755 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -183,7 +183,7 @@ final class ApiController extends Controller $unit = $this->createUnitFromRequest($request); $this->createModel($request->getHeader()->getAccount(), $unit, UnitMapper::class, 'unit', $request->getOrigin()); - if ($this->app->appSettings->get(null, SettingsEnum::GROUP_GENERATE_AUTOMATICALLY_UNIT) === '1') { + if ($this->app->appSettings->get(null, SettingsEnum::GROUP_GENERATE_AUTOMATICALLY_UNIT)['content'] === '1') { $newRequest = new HttpRequest(); $newRequest->setData('name', 'org:unit:' . \strtolower($unit->getName())); $newRequest->setData('status', GroupStatus::ACTIVE); @@ -397,7 +397,7 @@ final class ApiController extends Controller $position = $this->createPositionFromRequest($request); $this->createModel($request->getHeader()->getAccount(), $position, PositionMapper::class, 'position', $request->getOrigin()); - if ($this->app->appSettings->get(null, SettingsEnum::GROUP_GENERATE_AUTOMATICALLY_POSITION) === '1') { + if ($this->app->appSettings->get(null, SettingsEnum::GROUP_GENERATE_AUTOMATICALLY_POSITION)['content'] === '1') { $newRequest = new HttpRequest(); $newRequest->setData('name', 'org:pos:' . \strtolower($position->getName())); $newRequest->setData('status', GroupStatus::ACTIVE); @@ -574,7 +574,7 @@ final class ApiController extends Controller $department = $this->createDepartmentFromRequest($request); $this->createModel($request->getHeader()->getAccount(), $department, DepartmentMapper::class, 'department', $request->getOrigin()); - if ($this->app->appSettings->get(null, SettingsEnum::GROUP_GENERATE_AUTOMATICALLY_DEPARTMENT) === '1') { + if ($this->app->appSettings->get(null, SettingsEnum::GROUP_GENERATE_AUTOMATICALLY_DEPARTMENT)['content'] === '1') { $newRequest = new HttpRequest(); $newRequest->setData('name', 'org:dep:' . \strtolower($department->getName())); $newRequest->setData('status', GroupStatus::ACTIVE);