diff --git a/backend/src/Controller/UserController.php b/backend/src/Controller/UserController.php index 67c8e7d..2c0519a 100644 --- a/backend/src/Controller/UserController.php +++ b/backend/src/Controller/UserController.php @@ -22,6 +22,18 @@ class UserController extends Controller return new DataResponse([ 'username' => $user->getUsername(), 'roles' => $user->getRoles(), + 'projects' => $user->getProjects()->map(function($project) { + return [ + 'id' => $project->getId(), + 'name' => $project->getName(), + ]; + })->toArray(), + 'requests' => $user->getRequests()->map(function($request) { + return [ + 'id' => $request->getId(), + 'title' => $request->getTitle(), + ]; + })->toArray(), ]); }