mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-22 01:49:05 +02:00
Add proper length constraint validations to all string mapped ORM fields, so they show a nice validation error, instead of a 500 error
Fixes issue #544
This commit is contained in:
parent
113e5b3bcd
commit
dc7c13479c
17 changed files with 43 additions and 0 deletions
|
@ -151,6 +151,7 @@ abstract class AbstractParameter extends AbstractNamedDBElement
|
|||
*/
|
||||
#[Groups(['full', 'parameter:read', 'parameter:write'])]
|
||||
#[ORM\Column(type: Types::STRING)]
|
||||
#[Assert\Length(max: 50)]
|
||||
protected string $unit = '';
|
||||
|
||||
/**
|
||||
|
@ -158,6 +159,7 @@ abstract class AbstractParameter extends AbstractNamedDBElement
|
|||
*/
|
||||
#[Groups(['full', 'parameter:read', 'parameter:write'])]
|
||||
#[ORM\Column(type: Types::STRING)]
|
||||
#[Assert\Length(max: 255)]
|
||||
protected string $value_text = '';
|
||||
|
||||
/**
|
||||
|
@ -165,6 +167,7 @@ abstract class AbstractParameter extends AbstractNamedDBElement
|
|||
*/
|
||||
#[Groups(['full', 'parameter:read', 'parameter:write'])]
|
||||
#[ORM\Column(name: 'param_group', type: Types::STRING)]
|
||||
#[Assert\Length(max: 255)]
|
||||
protected string $group = '';
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue