feat: reorganized achevements queries and added client achievements request

This commit is contained in:
Mikhail Shabanov committed 2021-06-02 14:34:00 +02:00
1 parent 8da5bdbfa8
commit 11b8b15a2a
37 files changed
+1940 -781

No files matched your search

@@ -54,6 +54,8 @@ namespace WotBlitzStatisticsPro.Logic.Mappers
.ForMember(d => d.Id, o => o.Ignore())
.ForMember(d => d.AchievementValue, o => o.Ignore())
.ForMember(d => d.MaxSeriesValue, s => s.Ignore())
.ForMember(d => d.MedalType,
o => o.MapFrom(s => s.Type))
;
}
}
@@ -81,7 +81,7 @@ namespace WotBlitzStatisticsPro.Logic
var response = new AccountAchievementsResponse
{
AccountId = accountId,
AchievementSections = sections
Sections = sections
};
if (wgAchievements?.Achievements == null)
@@ -138,9 +138,9 @@ namespace WotBlitzStatisticsPro.Logic
}
// Sort achievements by sections
foreach (var section in response.AchievementSections)
foreach (var section in response.Sections)
{
section.Achievements = achievements.Where(a => a.SectionId == section.SectionId).ToList();
section.Medals = achievements.Where(a => a.SectionId == section.SectionId).ToList();
}
return response;