From 14b15a9816e54f61c523d3099ec341e57d798ca3 Mon Sep 17 00:00:00 2001 From: AdisakKanthawilang Date: Mon, 4 Aug 2025 15:33:20 +0700 Subject: [PATCH] revert code task #1693 --- .../Controllers/InsigniaRequestController.cs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/BMA.EHR.Insignia/Controllers/InsigniaRequestController.cs b/BMA.EHR.Insignia/Controllers/InsigniaRequestController.cs index 27c77f5c..29cab3d2 100644 --- a/BMA.EHR.Insignia/Controllers/InsigniaRequestController.cs +++ b/BMA.EHR.Insignia/Controllers/InsigniaRequestController.cs @@ -336,8 +336,14 @@ namespace BMA.EHR.Insignia.Service.Controllers //} if (role.Trim().ToLower() == "officer") { - resend.Items = (await _repository.InsigniaHasProfile(result.PeriodId, ocId, status, type)) - .Where(x => x.ProfileType!.ToLower() == type.ToLower()).ToList(); + /* resend.Items = (await _repository.InsigniaHasProfile(result.PeriodId, ocId, status, type)) + .Where(x => x.ProfileType!.ToLower() == type.ToLower()).ToList();*/ + var items = await _repository.InsigniaHasProfile(result.PeriodId, ocId, status, type); + + resend.Items = (items ?? new List()) + .Where(x => x != null && !string.IsNullOrEmpty(x.ProfileType) && x.ProfileType.ToLower() == type.ToLower()) + .ToList(); + return Success(resend); } else @@ -2468,11 +2474,11 @@ namespace BMA.EHR.Insignia.Service.Controllers receiveDate = profile.DateReceive!.Value, dateAnnounce = profile.Date!.Value, insigniaId = profile.RequestInsignia!.Id, - issue = "", + issue = profile!.Issue ?? "", note = "", refCommandDate = null, refCommandNo = "", - volume = "", + volume = profile!.VolumeNo ?? "", }; await _userProfileRepository.PostProfileInsigniaAsync(profileInsigniaBody, AccessToken); @@ -2490,11 +2496,11 @@ namespace BMA.EHR.Insignia.Service.Controllers receiveDate = profile.DateReceive!.Value, dateAnnounce = profile.Date!.Value, insigniaId = profile.RequestInsignia!.Id, - issue = "", + issue = profile!.Issue ?? "", note = "", refCommandDate = null, refCommandNo = "", - volume = "", + volume = profile!.VolumeNo ?? "", }; await _userProfileRepository.PostProfileEmpInsigniaAsync(profileInsigniaBody, AccessToken);