feat(api): в UnitWithAttributesResponse добавлены родительские и дочерние ЭК

This commit is contained in:
Mikhail Trubnikov
2025-08-27 10:43:33 +10:00
parent b288888d7a
commit c9159f6546
3 changed files with 12 additions and 2 deletions

View File

@@ -53,7 +53,9 @@ namespace PARR.API.Controllers.V1
.Include(t => t.UnitValues)
.ThenInclude(uv => uv.Value)
.Include(tf => tf.UnitValues)
.ThenInclude(uv => uv.Field);
.ThenInclude(uv => uv.Field)
.Include(p => p.ParentUnits).ThenInclude(t=>t.ParentUnit)
.Include(c => c.ChildUnits).ThenInclude(t=>t.ChildUnit);
var units = await unitService.GetPage(query, paginationFilter).ToListAsync();
@@ -80,6 +82,8 @@ namespace PARR.API.Controllers.V1
.ThenInclude(uv => uv.Value)
.Include(tf => tf.UnitValues)
.ThenInclude(uv => uv.Field)
.Include(p => p.ParentUnits).ThenInclude(t => t.ParentUnit)
.Include(c => c.ChildUnits).ThenInclude(t => t.ChildUnit)
.FirstOrDefaultAsync(t => t.Id == id);
if (unit == null)