fix up API route return
This commit is contained in:
parent
9d55e93e9e
commit
06422b2055
6 changed files with 11 additions and 16 deletions
|
@ -58,7 +58,7 @@ class LocationController extends BaseController
|
|||
$location->nodes = explode(',', $location->nodes);
|
||||
}
|
||||
|
||||
return $locations;
|
||||
return $locations->toArray();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -62,8 +62,7 @@ class NodeController extends BaseController
|
|||
*/
|
||||
public function list(Request $request)
|
||||
{
|
||||
$nodes = Models\Node::paginate(50);
|
||||
return $this->response->paginator($nodes, new NodeTransformer);
|
||||
return Models\Node::all()->toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -170,11 +169,11 @@ class NodeController extends BaseController
|
|||
*/
|
||||
public function allocations(Request $request)
|
||||
{
|
||||
$allocations = Models\Allocation::paginate(100);
|
||||
$allocations = Models\Allocation::all();
|
||||
if ($allocations->count() < 1) {
|
||||
throw new NotFoundHttpException('No allocations have been created.');
|
||||
}
|
||||
return $this->response->paginator($allocations, new AllocationTransformer);
|
||||
return $allocations;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -132,28 +132,25 @@ class ServerController extends BaseController
|
|||
]
|
||||
]);
|
||||
|
||||
$server->toArray();
|
||||
|
||||
// Only return the daemon token if the request is using HTTPS
|
||||
if ($request->secure()) {
|
||||
$server->daemon_token = $server->daemonSecret;
|
||||
}
|
||||
$server->daemon = json_decode($response->getBody())->{$server->uuid};
|
||||
|
||||
return $server;
|
||||
return $server->toArray();
|
||||
}
|
||||
|
||||
return $server;
|
||||
return $server->toArray();
|
||||
|
||||
} catch (NotFoundHttpException $ex) {
|
||||
throw $ex;
|
||||
} catch (\GuzzleHttp\Exception\TransferException $ex) {
|
||||
// Couldn't hit the daemon, return what we have though.
|
||||
$server->toArray();
|
||||
$server->daemon = [
|
||||
'error' => 'There was an error encountered while attempting to connect to the remote daemon.'
|
||||
];
|
||||
return $server;
|
||||
return $server->toArray();
|
||||
} catch (\Exception $ex) {
|
||||
throw new BadRequestHttpException('There was an issue with the fields passed in the request.');
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ class ServiceController extends BaseController
|
|||
|
||||
public function list(Request $request)
|
||||
{
|
||||
return Models\Service::all();
|
||||
return Models\Service::all()->toArray();
|
||||
}
|
||||
|
||||
public function view(Request $request, $id)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue