mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
temp api fix
This commit is contained in:
parent
1f121c31a1
commit
f2f91fd3ca
2 changed files with 4 additions and 15 deletions
|
|
@ -8,24 +8,16 @@ namespace FilterLists.Services.FilterList.MappingProfiles
|
|||
[UsedImplicitly]
|
||||
public class ListDetailsDtoMappingProfile : Profile
|
||||
{
|
||||
//TODO: fix UpdatedDate to look at most recent snapshot with changes
|
||||
//TODO: fix UpdatedDate and RuleCount
|
||||
public ListDetailsDtoMappingProfile() =>
|
||||
CreateMap<Data.Entities.FilterList, ListDetailsDto>()
|
||||
.ForMember(d => d.Languages, c => c.MapFrom(l => l.FilterListLanguages.Select(la => la.Language.Name)))
|
||||
.ForMember(d => d.Maintainers, c => c.MapFrom(l => l.FilterListMaintainers.Select(m => m.Maintainer)))
|
||||
.ForMember(d => d.Tags, c => c.MapFrom(l => l.FilterListTags.Select(m => m.Tag)))
|
||||
.ForMember(d => d.RuleCount,
|
||||
c => c.MapFrom(l =>
|
||||
l.Snapshots.Where(s => s.WasSuccessful)
|
||||
.OrderByDescending(s => s.CreatedDateUtc)
|
||||
.FirstOrDefault()
|
||||
.SnapshotRules
|
||||
.Count))
|
||||
c => c.MapFrom(l => 0))
|
||||
.ForMember(d => d.UpdatedDate,
|
||||
c => c.MapFrom(l =>
|
||||
l.Snapshots.Where(s => s.WasSuccessful)
|
||||
.OrderByDescending(s => s.CreatedDateUtc)
|
||||
.FirstOrDefault()
|
||||
.CreatedDateUtc));
|
||||
l.ModifiedDateUtc));
|
||||
}
|
||||
}
|
||||
|
|
@ -15,9 +15,6 @@ public ListSummaryDtoMappingProfile() =>
|
|||
.ForMember(d => d.Tags, c => c.MapFrom(l => l.FilterListTags.Select(m => m.Tag)))
|
||||
.ForMember(d => d.UpdatedDate,
|
||||
c => c.MapFrom(l =>
|
||||
l.Snapshots.Where(s => s.WasSuccessful)
|
||||
.OrderByDescending(s => s.CreatedDateUtc)
|
||||
.FirstOrDefault()
|
||||
.CreatedDateUtc));
|
||||
l.ModifiedDateUtc));
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue