From 36cc7d88551e41e639a5feb6e030fa4126e09a69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Sch=C3=A4r?= Date: Wed, 26 Jun 2024 10:36:29 +0200 Subject: [PATCH] adding values to array in loop instead of overwriting it --- app/Http/Controllers/RestApi/ApiHelper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/RestApi/ApiHelper.php b/app/Http/Controllers/RestApi/ApiHelper.php index 93a50b5..a841f16 100644 --- a/app/Http/Controllers/RestApi/ApiHelper.php +++ b/app/Http/Controllers/RestApi/ApiHelper.php @@ -53,7 +53,7 @@ public static function getMemberAsArray(Member $member, array $allowedGroups, $i foreach ($allowedGroups as $group) { $rootGroupIds = $member->getFirstLevelGroupIds($group->getId()); foreach ($rootGroupIds as $id) { - $rootGroups = $groupRepo->get($id)->getName(); + $rootGroups[] = $groupRepo->get($id)->getName(); } }