Tighten common code validation and group selection
This commit is contained in:
@@ -5,7 +5,9 @@
|
|||||||
ValueChanged="OnSelectedGroupChanged"
|
ValueChanged="OnSelectedGroupChanged"
|
||||||
Label="코드 그룹"
|
Label="코드 그룹"
|
||||||
Variant="Variant.Outlined"
|
Variant="Variant.Outlined"
|
||||||
FullWidth="true">
|
FullWidth="true"
|
||||||
|
Clearable="true">
|
||||||
|
<MudSelectItem Value="@string.Empty">선택</MudSelectItem>
|
||||||
@foreach (var group in Groups)
|
@foreach (var group in Groups)
|
||||||
{
|
{
|
||||||
<MudSelectItem Value="@group">@group</MudSelectItem>
|
<MudSelectItem Value="@group">@group</MudSelectItem>
|
||||||
|
|||||||
@@ -64,6 +64,8 @@ public class CommonCodeController(CommonCodeService commonCodeService) : Control
|
|||||||
{
|
{
|
||||||
if (string.IsNullOrWhiteSpace(code.CodeGroup) || string.IsNullOrWhiteSpace(code.CodeValue) || string.IsNullOrWhiteSpace(code.CodeName))
|
if (string.IsNullOrWhiteSpace(code.CodeGroup) || string.IsNullOrWhiteSpace(code.CodeValue) || string.IsNullOrWhiteSpace(code.CodeName))
|
||||||
return BadRequest(new { error = "코드 그룹, 값, 이름은 필수입니다." });
|
return BadRequest(new { error = "코드 그룹, 값, 이름은 필수입니다." });
|
||||||
|
if (code.CodeGroup.Any(char.IsWhiteSpace))
|
||||||
|
return BadRequest(new { error = "code_group에는 공백을 사용할 수 없습니다." });
|
||||||
if (code.CodeValue.Contains(' '))
|
if (code.CodeValue.Contains(' '))
|
||||||
return BadRequest(new { error = "code_value에는 공백을 사용할 수 없습니다." });
|
return BadRequest(new { error = "code_value에는 공백을 사용할 수 없습니다." });
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user