This commit is contained in:
AdisakKanthawilang 2024-09-11 15:59:38 +07:00
parent 172a917086
commit 0fd8e81d71
5 changed files with 32 additions and 2 deletions

View file

@ -174,7 +174,12 @@ namespace BMA.EHR.Retirement.Service.Controllers
[HttpGet()]
public async Task<ActionResult<ResponseObject>> GetListByAdmin()
{
var getPermission = await _permission.GetPermissionAPIAsync("LIST", "SYS_RESIGN");
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
if (jsonData["status"]?.ToString() != "200")
{
return Error(jsonData["message"]?.ToString(), StatusCodes.Status403Forbidden);
}
var retirementResigns = await _context.RetirementResigns.AsQueryable()
.OrderByDescending(x => x.CreatedAt)
.Select(p => new
@ -1083,6 +1088,12 @@ $"คำขอลาออกของ {updated.prefix}{updated.firstName} {upda
[HttpGet("questionnaire")]
public async Task<ActionResult<ResponseObject>> GetListQuestion()
{
var getPermission = await _permission.GetPermissionAPIAsync("LIST", "SYS_RESIGN_INTERVIEW");
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
if (jsonData["status"]?.ToString() != "200")
{
return Error(jsonData["message"]?.ToString(), StatusCodes.Status403Forbidden);
}
var data = await _context.RetirementQuestions.AsQueryable()
.OrderByDescending(x => x.CreatedAt)
.Select(p => new