* Make sure proper subfleets are returned as part of the user profile #848 * Formatting
This commit is contained in:
@@ -54,6 +54,26 @@ class UserService extends Service
|
||||
$this->userRepo = $userRepo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find the user and return them with all of the data properly attached
|
||||
*
|
||||
* @param $user_id
|
||||
*
|
||||
* @return User
|
||||
*/
|
||||
public function getUser($user_id): User
|
||||
{
|
||||
$user = $this->userRepo
|
||||
->with(['airline', 'bids', 'rank'])
|
||||
->find($user_id);
|
||||
|
||||
// Load the proper subfleets to the rank
|
||||
$user->rank->subfleets = $this->getAllowableSubfleets($user);
|
||||
$user->subfleets = $user->rank->subfleets;
|
||||
|
||||
return $user;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a pilot. Also attaches the initial roles
|
||||
* required, and then triggers the UserRegistered event
|
||||
|
||||
Reference in New Issue
Block a user