filters and sidebar
This commit is contained in:
@@ -21,36 +21,14 @@ class HomeController extends Controller
|
||||
{
|
||||
}
|
||||
|
||||
public function home(Request $request): View
|
||||
public function home(): View
|
||||
{
|
||||
$urlParams = $request->all();
|
||||
$users = $this->accountService->all();
|
||||
|
||||
$sort = data_get($urlParams, "sort") ?? "-_sys.updatedAt";
|
||||
$filter = data_get($urlParams, "filter") ?? [];
|
||||
$arguments = array_merge([
|
||||
"schema_in" => $this->accountService->currentReadableSchemas(),
|
||||
"status_in" => ["draft", "published"]
|
||||
], $filter);
|
||||
|
||||
$limit = 10;
|
||||
|
||||
$graph = $this->query
|
||||
->filter($arguments)
|
||||
->limit($limit)
|
||||
->childrenDepth(1)
|
||||
->parentsDepth(0)
|
||||
->sort($sort)
|
||||
->run();
|
||||
|
||||
|
||||
return view("lucent::home", [
|
||||
"users" => $users,
|
||||
"records" => $graph->getRootRecords(),
|
||||
"graph" => toArray($graph),
|
||||
"modalUrl" => $request->fullUrl(),
|
||||
]);
|
||||
|
||||
return $this->svelte->render(
|
||||
layout: "channel",
|
||||
view: "homeIndex",
|
||||
title: "Records",
|
||||
);
|
||||
}
|
||||
|
||||
public function records(Request $request): Response
|
||||
@@ -65,7 +43,7 @@ class HomeController extends Controller
|
||||
"status_in" => ["draft", "published"]
|
||||
], $filter);
|
||||
|
||||
$limit = 30;
|
||||
$limit = 20;
|
||||
|
||||
$graph = $this->query
|
||||
->filter($arguments)
|
||||
|
||||
Reference in New Issue
Block a user