mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-25 03:08:51 +02:00
Allow to show all parts of all categories in a single KiCad category by setting EDA_KICAD_CATEGORY_DEPTH to -1
This commit is contained in:
parent
459ae163da
commit
6926f6b233
3 changed files with 40 additions and 14 deletions
|
@ -62,9 +62,13 @@ class KiCadApiController extends AbstractController
|
|||
}
|
||||
|
||||
#[Route('/parts/category/{category}.json', name: 'kicad_api_category')]
|
||||
public function categoryParts(Category $category): Response
|
||||
public function categoryParts(?Category $category): Response
|
||||
{
|
||||
$this->denyAccessUnlessGranted('read', $category);
|
||||
if ($category) {
|
||||
$this->denyAccessUnlessGranted('read', $category);
|
||||
} else {
|
||||
$this->denyAccessUnlessGranted('@categories.read');
|
||||
}
|
||||
$this->denyAccessUnlessGranted('@parts.read');
|
||||
|
||||
return $this->json($this->kiCADHelper->getCategoryParts($category));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue