Load the user airline/bid ahead of time; SB XML name fix
This commit is contained in:
parent
3f7a7d0f2e
commit
62cea3eb0c
@ -77,7 +77,7 @@ class UserController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function index(Request $request)
|
public function index(Request $request)
|
||||||
{
|
{
|
||||||
return new UserResource(Auth::user());
|
return $this->get(Auth::user()->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -89,7 +89,11 @@ class UserController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function get($id)
|
public function get($id)
|
||||||
{
|
{
|
||||||
return new UserResource($this->userRepo->find($id));
|
$user = $this->userRepo
|
||||||
|
->with(['airline', 'bids'])
|
||||||
|
->find($id);
|
||||||
|
|
||||||
|
return new UserResource($user);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -37,10 +37,10 @@ class SimBriefXML extends SimpleXMLElement
|
|||||||
$base_url = $this->fms_downloads->directory;
|
$base_url = $this->fms_downloads->directory;
|
||||||
|
|
||||||
// TODO: Put vmsACARS on top
|
// TODO: Put vmsACARS on top
|
||||||
if (!empty($this->fms_downloads->vma)) {
|
if (!empty($this->fms_downloads->vms)) {
|
||||||
$fps[] = [
|
$fps[] = [
|
||||||
'name' => $this->fms_downloads->vma->name->__toString(),
|
'name' => $this->fms_downloads->vms->name->__toString(),
|
||||||
'url' => $base_url.$this->fms_downloads->vma->link,
|
'url' => $base_url.$this->fms_downloads->vms->link,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user