From f2f91fd3ca904963c7468569dee2ee58fa9b2307 Mon Sep 17 00:00:00 2001 From: "Collin M. Barrett" Date: Thu, 23 Aug 2018 15:02:56 -0500 Subject: [PATCH] temp api fix --- .../ListDetailsDtoMappingProfile.cs | 14 +++----------- .../ListSummaryDtoMappingProfile.cs | 5 +---- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/src/FilterLists.Services/FilterList/MappingProfiles/ListDetailsDtoMappingProfile.cs b/src/FilterLists.Services/FilterList/MappingProfiles/ListDetailsDtoMappingProfile.cs index a7e0072d7..145ca8bd6 100644 --- a/src/FilterLists.Services/FilterList/MappingProfiles/ListDetailsDtoMappingProfile.cs +++ b/src/FilterLists.Services/FilterList/MappingProfiles/ListDetailsDtoMappingProfile.cs @@ -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() .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)); } } \ No newline at end of file diff --git a/src/FilterLists.Services/FilterList/MappingProfiles/ListSummaryDtoMappingProfile.cs b/src/FilterLists.Services/FilterList/MappingProfiles/ListSummaryDtoMappingProfile.cs index 9c1a40a1d..888b0f527 100644 --- a/src/FilterLists.Services/FilterList/MappingProfiles/ListSummaryDtoMappingProfile.cs +++ b/src/FilterLists.Services/FilterList/MappingProfiles/ListSummaryDtoMappingProfile.cs @@ -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)); } } \ No newline at end of file