Tighten common code validation and group selection

This commit is contained in:
2026-07-02 17:03:43 +09:00
parent b1ac7129d9
commit 870b51ece4
2 changed files with 5 additions and 1 deletions
@@ -5,7 +5,9 @@
ValueChanged="OnSelectedGroupChanged"
Label="코드 그룹"
Variant="Variant.Outlined"
FullWidth="true">
FullWidth="true"
Clearable="true">
<MudSelectItem Value="@string.Empty">선택</MudSelectItem>
@foreach (var group in Groups)
{
<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))
return BadRequest(new { error = "코드 그룹, 값, 이름은 필수입니다." });
if (code.CodeGroup.Any(char.IsWhiteSpace))
return BadRequest(new { error = "code_group에는 공백을 사용할 수 없습니다." });
if (code.CodeValue.Contains(' '))
return BadRequest(new { error = "code_value에는 공백을 사용할 수 없습니다." });