Skip to content

Commit

Permalink
Also in frontend trainings statistics
Browse files Browse the repository at this point in the history
  • Loading branch information
TDroogers committed Sep 27, 2024
1 parent 46a06bf commit 52862b0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public async Task UpdateAnalyzeYearChartAll()
_renderChart = false;
await Task.Delay(1); // Will not update without this delay
StateHasChanged();
var analyzeData = await ReportTrainingRepository.AnalyzeYearChartsAll(SelectedUsers, _cls.Token);
var analyzeData = await ReportTrainingRepository.AnalyzeYearChartsAll(SelectedUsers, AllYears ? null : 5, _cls.Token);
if (analyzeData is null) return;
_elapsedMilliseconds = analyzeData.ElapsedMilliseconds;
_data = StatisticsTab.DrawLineChartAll(analyzeData, AllYears);
Expand Down
3 changes: 2 additions & 1 deletion src/Client/Repositories/ReportTrainingRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,15 @@ public async Task<MultipleReportTrainingsResponse> GetLastTraining(IEnumerable<D
return result;
}

public async Task<AnalyzeYearChartAllResponse?> AnalyzeYearChartsAll(IEnumerable<DrogeUser> users, CancellationToken clt)
public async Task<AnalyzeYearChartAllResponse?> AnalyzeYearChartsAll(IEnumerable<DrogeUser> users, int? years, CancellationToken clt)
{
try
{
DebugHelper.WriteLine("dupe");
var request = new AnalyzeTrainingRequest()
{
Users = users.Select(x => (Guid?)x.Id).ToList(),
Years = years
};
var result = await _reportTrainingClient.AnalyzeYearChartsAllAsync(request, clt);
return result;
Expand Down

0 comments on commit 52862b0

Please sign in to comment.