From af00016801c99fd1b0c0b18344a1c0a4ecd61726 Mon Sep 17 00:00:00 2001 From: Kittapath Date: Thu, 6 Jul 2023 14:41:39 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B8=8A=E0=B8=B7?= =?UTF-8?q?=E0=B9=88=E0=B8=AD=E0=B8=9F=E0=B8=B1=E0=B8=87=E0=B8=81=E0=B9=8C?= =?UTF-8?q?=E0=B8=8A=E0=B8=B1=E0=B8=99=E0=B8=9B=E0=B8=A3=E0=B8=B0=E0=B8=A7?= =?UTF-8?q?=E0=B8=B1=E0=B8=95=E0=B8=B4=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B8=A8?= =?UTF-8?q?=E0=B8=B6=E0=B8=81=E0=B8=A9=E0=B8=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/PlacementController.cs | 27 +++++-------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementController.cs index d8b1a387..27d91291 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementController.cs @@ -709,23 +709,8 @@ namespace BMA.EHR.Placement.Service.Controllers return Success(); } - [HttpGet("education/{personalId:length(36)}")] - public async Task> UpdateEducation([FromBody] PersonEducationRequest req, Guid personalId) - { - var person = await _context.PlacementProfiles.FindAsync(personalId); - if (person == null) - return Error(GlobalMessages.DataNotFound, 404); - - person.LastUpdateFullName = FullName ?? "System Administrator"; - person.LastUpdateUserId = UserId ?? ""; - person.LastUpdatedAt = DateTime.Now; - _context.SaveChanges(); - - return Success(); - } - [HttpPut("education/{personalId:length(36)}")] - public async Task> UpdateEducationByPerson([FromBody] PersonEducationRequest req, Guid personalId) + public async Task> UpdateEducation([FromBody] PersonEducationRequest req, Guid personalId) { var education = await _context.PlacementEducations .Include(x => x.PlacementProfile) @@ -733,18 +718,18 @@ namespace BMA.EHR.Placement.Service.Controllers if (education == null) return Error(GlobalMessages.DataNotFound, 404); - if (req.Id == null) + if (req.Id == null) { var data = new PlacementEducation { PlacementProfile = education.PlacementProfile, - Institute = req.Institute, + Institute = req.Institute, Degree = req.Degree, Field = req.Field, - Gpa = req.Gpa, + Gpa = req.Gpa, Country = req.Country, Duration = req.Duration, - DurationYear = req.DurationYear, + DurationYear = req.DurationYear, Other = req.Other, FundName = req.FundName, FinishDate = req.FinishDate, @@ -761,7 +746,7 @@ namespace BMA.EHR.Placement.Service.Controllers } else { - education.Institute = req.Institute; + education.Institute = req.Institute; education.Degree = req.Degree; education.Field = req.Field; education.Gpa = req.Gpa;