From 9f39e01172fb677e0b541c812908c0633bfaa243 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Wed, 27 Sep 2023 21:42:23 +0000 Subject: [PATCH] fix tests --- Controller/ApiController.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Controller/ApiController.php b/Controller/ApiController.php index 4b1146e..af154ee 100755 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -129,8 +129,10 @@ final class ApiController extends Controller foreach ($accounts as $account) { /** @var Profile $profile Profile */ - $profile = ProfileMapper::get()->where('account', (int) $account)->execute(); - $employees[] = new Employee($profile); + $profile = ProfileMapper::get()->where('account', (int) $account)->execute(); + $employee = EmployeeMapper::get()->where('profile', $profile->id)->execute(); + + $employees[] = $employee->id === 0 ? new Employee($profile) : $employee; } return $employees;