CheckListHeader lista javítva

This commit is contained in:
2025-03-22 11:19:18 +01:00
parent 15e6aac88c
commit 6d78762275
3 changed files with 19 additions and 17 deletions
@@ -44,6 +44,7 @@ namespace WorkFlowCheck.BL.Mappings
CreateMap<EquipmentDTO, Equipment>(); CreateMap<EquipmentDTO, Equipment>();
CreateMap<CheckListHeader, CheckListHeaderDTO>() CreateMap<CheckListHeader, CheckListHeaderDTO>()
.ForMember(dest => dest.UserDTO, opt => opt.MapFrom(src => src.User))
.ForMember(dest => dest.CheckListRowDTO, opt => opt.MapFrom(src => src.CheckListRows)); .ForMember(dest => dest.CheckListRowDTO, opt => opt.MapFrom(src => src.CheckListRows));
} }
} }
@@ -61,6 +61,7 @@ namespace WorkFlowCheck.BL.Services
{ {
var roles = await _dbContext.CheckListHeaders var roles = await _dbContext.CheckListHeaders
.Include(i => i.CheckListRows) .Include(i => i.CheckListRows)
.Include(i=>i.User)
.AsNoTracking() .AsNoTracking()
.ToListAsync(); .ToListAsync();
if (roles != null) if (roles != null)
@@ -66,19 +66,19 @@
} }
}, },
{ data: "documentNumber", { data: "documentNumber"},
render: function (data, type, row) { { data: "dateExecution",
if (!data) return ''; render: function (data, type, row) {
if (type === 'display' || type === 'filter') { if (!data) return '';
return dayjs(data).format('YYYY.MM.DD'); if (type === 'display' || type === 'filter') {
} return dayjs(data).format('YYYY.MM.DD');
return data; }
} return data;
}
}, },
{ data: "dateExecution" },
{ data: "shortName" }, { data: "shortName" },
{ data: "description" }, { data: "description" },
{ data: "user.userName" }, { data: "userDTO.userName" },
{ data: null, render: function (data, type, row) { { data: null, render: function (data, type, row) {
return renderActionButtons(row.id); return renderActionButtons(row.id);
}} }}