Skip to content

Commit

Permalink
Merge branch 'dev' into patch-3
Browse files Browse the repository at this point in the history
  • Loading branch information
FatihKoz authored Sep 8, 2024
2 parents f73135c + cce6c2e commit d3b70c6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions app/Http/Controllers/Api/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,21 @@ protected function getUserId(Request $request): mixed
*/
public function index(Request $request): UserResource
{
return $this->get(Auth::user()->id);
$with_subfleets = (!$request->has('with') || str_contains($request->input('with', ''), 'subfleets'));
return $this->get(Auth::user()->id, $with_subfleets);
}

/**
* Get the profile for the passed-in user
*
* @param int $id
* @param int $id
* @param Request $request
*
* @return UserResource
*/
public function get(int $id): UserResource
public function get(int $id, bool $with_subfleets = true): UserResource
{
$user = $this->userSvc->getUser($id, false);
$user = $this->userSvc->getUser($id, $with_subfleets);
if ($user === null) {
throw new UserNotFound();
}
Expand Down
2 changes: 1 addition & 1 deletion app/Services/BidService.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function getBid(User $user, $bid_id): ?Bid
*
* @return Bid[]
*/
public function findBidsForUser(User $user, array $relations): Collection|array|null
public function findBidsForUser(User $user, array $relations = ['subfleets', 'simbrief_aircraft']): Collection|array|null
{
$with = [
'aircraft',
Expand Down

0 comments on commit d3b70c6

Please sign in to comment.