/api/v1/me: ajout des requêtes/projets de l'utilisateur
This commit is contained in:
parent
a311d67f39
commit
3510e66882
|
@ -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(),
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue