mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 01:25:55 +02:00
Added a route to show all parts.
This commit is contained in:
parent
ba33399b20
commit
ce77f287e7
2 changed files with 23 additions and 0 deletions
|
@ -1,5 +1,8 @@
|
|||
# Latest documentation available at https://omines.github.io/datatables-bundle/#configuration
|
||||
datatables:
|
||||
|
||||
language_from_cdn: false
|
||||
|
||||
# Set options, as documented at https://datatables.net/reference/option/
|
||||
options:
|
||||
lengthMenu : [10, 25, 50, 100, 250, 500, 1000, 2500]
|
||||
|
|
|
@ -75,5 +75,25 @@ class PartListsController extends AbstractController
|
|||
return $this->render('parts_list.html.twig', ['datatable' => $table]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/parts")
|
||||
*
|
||||
* @param Request $request
|
||||
* @param DataTableFactory $dataTable
|
||||
* @return \Symfony\Component\HttpFoundation\JsonResponse|\Symfony\Component\HttpFoundation\Response
|
||||
*/
|
||||
public function showAll(Request $request, DataTableFactory $dataTable)
|
||||
{
|
||||
$table = $dataTable->createFromType(PartsDataTable::class)
|
||||
->handleRequest($request);
|
||||
|
||||
|
||||
if ($table->isCallback()) {
|
||||
return $table->getResponse();
|
||||
}
|
||||
|
||||
return $this->render('parts_list.html.twig', ['datatable' => $table]);
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue