mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-03-04 06:25:22 +01:00
Allow to specify which label profiles are shown in dropdown.
This commit is contained in:
@@ -36,8 +36,10 @@ class LabelProfileRepository extends NamedDBElementRepository
|
||||
*/
|
||||
public function getDropdownProfiles(string $type): array
|
||||
{
|
||||
//TODO: Improve this, when we have a 'showInDropdown' flag for profiles.
|
||||
return $this->findForSupportedElement($type);
|
||||
if (!in_array($type, LabelOptions::SUPPORTED_ELEMENTS)) {
|
||||
throw new \InvalidArgumentException('Invalid supported_element type given.');
|
||||
}
|
||||
return $this->findBy(['options.supported_element' => $type, 'show_in_dropdown' => true], ['name' => 'ASC']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user