เพิ่ม API

This commit is contained in:
Suphonchai Phoonsawat 2023-08-17 13:05:05 +07:00
parent 5c5c85a120
commit c649861bd6
2 changed files with 61 additions and 1 deletions

View file

@ -1240,7 +1240,16 @@ namespace BMA.EHR.Application.Repositories.Commands
var rootOcId = await GetRootOcIdAsync(UserOrganizationId);
var oc = await _dbContext.Set<OrganizationEntity>().FirstOrDefaultAsync(x => x.Id == rootOcId);
var oc = await _dbContext.Set<OrganizationEntity>()
.Include(x => x.OrganizationOrganization)
.Select(x => new KeyValueItemResponse
{
Id = x.Id,
Name = x.OrganizationOrganization!.Name
})
.FirstOrDefaultAsync(x => x.Id == rootOcId);
if (oc != null)
ret.Add(oc);
return ret;
}