mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 17:39:06 +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
|
@ -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