File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -710,6 +710,9 @@ public function delete(Request $illuminateRequest): JsonResponse
710710 return response ()->json ($ contextProps , Response::HTTP_OK );
711711 }
712712
713+ /**
714+ * Get a list of available user groups
715+ */
713716 public function getUserGroups (Request $ illuminateRequest ): JsonResponse
714717 {
715718 $ contextId = (int ) $ illuminateRequest ->route ('contextId ' );
@@ -723,7 +726,20 @@ public function getUserGroups(Request $illuminateRequest): JsonResponse
723726 ], Response::HTTP_NOT_FOUND );
724727 }
725728
726- $ userGroups = UserGroup::withContextIds ([$ context ->getId ()])->get ();
729+ $ collector = UserGroup::withContextIds ([$ context ->getId ()]);
730+
731+ foreach ($ illuminateRequest ->query () as $ param => $ val ) {
732+ switch ($ param ) {
733+ case 'stageIds ' :
734+ $ collector ->withStageIds (array_map (intval (...), paramToArray ($ val )));
735+ break ;
736+ case 'roleIds ' :
737+ $ collector ->withRoleIds (array_map (intval (...), paramToArray ($ val )));
738+ break ;
739+ }
740+ }
741+
742+ $ userGroups = $ collector ->get ();
727743
728744 return response ()->json (
729745 [
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ public function toArray($request)
2323 {
2424 return [
2525 'id ' => $ this ->id ,
26- 'roleId ' => $ this ->contents ,
26+ 'roleId ' => $ this ->roleId ,
2727 'isDefault ' => (bool ) $ this ->is_default ,
2828 'showTitle ' => (bool ) $ this ->show_title ,
2929 'name ' => $ this ->getLocalizedData ('name ' ),
You can’t perform that action at this time.
0 commit comments