diff --git a/TaxBaik.Web/Components/Admin/Pages/Contracts.razor b/TaxBaik.Web/Components/Admin/Pages/Contracts.razor index 4b70578..a31ec56 100644 --- a/TaxBaik.Web/Components/Admin/Pages/Contracts.razor +++ b/TaxBaik.Web/Components/Admin/Pages/Contracts.razor @@ -107,10 +107,10 @@ - + @foreach (var client in clients) { - @client.CompanyName + @(string.IsNullOrEmpty(client.CompanyName) ? client.Name : client.CompanyName) } @@ -180,7 +180,7 @@ { contractForm = new ContractForm { - ClientId = clients.FirstOrDefault()?.Id ?? 0, + ClientId = clients.FirstOrDefault()?.Id, StartDate = DateTime.Today }; isDialogOpen = true; @@ -200,8 +200,9 @@ try { + if (contractForm.ClientId == null) return; var newId = await ContractClient.CreateAsync( - contractForm.ClientId, + contractForm.ClientId.Value, contractForm.ContractNumber, contractForm.ServiceType, contractForm.StartDate ?? DateTime.Now, @@ -254,7 +255,7 @@ private class ContractForm { - public int ClientId { get; set; } + public int? ClientId { get; set; } public string ContractNumber { get; set; } = ""; public string ServiceType { get; set; } = ""; public DateTime? StartDate { get; set; } diff --git a/TaxBaik.Web/Components/Admin/Pages/TaxFilingSchedules.razor b/TaxBaik.Web/Components/Admin/Pages/TaxFilingSchedules.razor index 14ce07b..51e45ca 100644 --- a/TaxBaik.Web/Components/Admin/Pages/TaxFilingSchedules.razor +++ b/TaxBaik.Web/Components/Admin/Pages/TaxFilingSchedules.razor @@ -117,16 +117,17 @@ - + Class="mb-4" + RequiredError="고객을 선택하세요."> @foreach (var client in clients) { - @client.CompanyName + @(string.IsNullOrEmpty(client.CompanyName) ? client.Name : client.CompanyName) } @@ -197,7 +198,7 @@ { FilingYear = DateTime.Now.Year, DueDate = DateTime.Today, - ClientId = clients.FirstOrDefault()?.Id ?? 0 + ClientId = clients.FirstOrDefault()?.Id }; isDialogOpen = true; } @@ -216,8 +217,9 @@ try { + if (scheduleForm.ClientId == null) return; var newId = await TaxFilingClient.CreateAsync( - scheduleForm.ClientId, + scheduleForm.ClientId.Value, scheduleForm.FilingType, scheduleForm.DueDate ?? DateTime.Today, scheduleForm.FilingYear); diff --git a/TaxBaik.Web/Components/Admin/Pages/TaxProfiles.razor b/TaxBaik.Web/Components/Admin/Pages/TaxProfiles.razor index 4b29aaa..4098001 100644 --- a/TaxBaik.Web/Components/Admin/Pages/TaxProfiles.razor +++ b/TaxBaik.Web/Components/Admin/Pages/TaxProfiles.razor @@ -84,10 +84,10 @@ else - + @foreach (var client in clients) { - @client.CompanyName + @(string.IsNullOrEmpty(client.CompanyName) ? client.Name : client.CompanyName) } @@ -166,7 +166,7 @@ else editingProfile = null; profileForm = new TaxProfileForm { - ClientId = clients.FirstOrDefault()?.Id ?? 0, + ClientId = clients.FirstOrDefault()?.Id, TaxRiskLevel = "normal", NextFilingDueDate = DateTime.Today.AddMonths(1) }; @@ -202,15 +202,11 @@ else try { - if (isEditMode) + if (isEditMode && editingProfile != null) { - await TaxProfileClient.UpdateAsync( - editingProfile!.Id, - profileForm.BusinessType, - null, - profileForm.NextFilingDueDate, - profileForm.TaxRiskLevel); - Snackbar.Add("세무 프로필이 업데이트되었습니다.", Severity.Success); + await TaxProfileClient.UpdateAsync(editingProfile.Id, profileForm.BusinessType, + null, profileForm.NextFilingDueDate, profileForm.TaxRiskLevel); + Snackbar.Add("세무 프로필이 수정되었습니다.", Severity.Success); } else { diff --git a/tests/e2e/helpers/admin-auth.ts b/tests/e2e/helpers/admin-auth.ts index 7dd29b4..8a27d90 100644 --- a/tests/e2e/helpers/admin-auth.ts +++ b/tests/e2e/helpers/admin-auth.ts @@ -62,6 +62,9 @@ export async function navigateInBlazor(page: Page, targetUrl: string) { // Wait until Blazor Server completes connection and hides the loading spinner overlay await page.locator('#blazor-loading').waitFor({ state: 'hidden', timeout: 15000 }).catch(() => {}); + // Give the SPA router a brief window to unmount the previous page and mount the loading spinner + await page.waitForTimeout(500); + // Also wait for MudBlazor's dynamic loading spinners to disappear (ensuring the grid is interactive) const spinner = page.locator('.mud-progress-circular, .mud-progress-linear-bar'); try {