From 870b51ece421e3df4220a1b4ad06d7bfdd89eb7e Mon Sep 17 00:00:00 2001 From: kjh2064 Date: Thu, 2 Jul 2026 17:03:43 +0900 Subject: [PATCH] Tighten common code validation and group selection --- .../Components/Admin/Shared/CommonCodeGroupPanel.razor | 4 +++- TaxBaik.Web/Controllers/CommonCodeController.cs | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/TaxBaik.Web/Components/Admin/Shared/CommonCodeGroupPanel.razor b/TaxBaik.Web/Components/Admin/Shared/CommonCodeGroupPanel.razor index 62d3215..de57a06 100644 --- a/TaxBaik.Web/Components/Admin/Shared/CommonCodeGroupPanel.razor +++ b/TaxBaik.Web/Components/Admin/Shared/CommonCodeGroupPanel.razor @@ -5,7 +5,9 @@ ValueChanged="OnSelectedGroupChanged" Label="코드 그룹" Variant="Variant.Outlined" - FullWidth="true"> + FullWidth="true" + Clearable="true"> + 선택 @foreach (var group in Groups) { @group diff --git a/TaxBaik.Web/Controllers/CommonCodeController.cs b/TaxBaik.Web/Controllers/CommonCodeController.cs index 8d70f49..38ab6c6 100644 --- a/TaxBaik.Web/Controllers/CommonCodeController.cs +++ b/TaxBaik.Web/Controllers/CommonCodeController.cs @@ -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에는 공백을 사용할 수 없습니다." });