1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

refactor: simplify summary generation (resolve #68)

This commit is contained in:
Ferdinand Mütsch
2020-11-07 12:01:35 +01:00
parent 8ddd9904a0
commit 2f12d8efde
15 changed files with 352 additions and 287 deletions

View File

@ -86,9 +86,7 @@ func (h *SummariesHandler) loadUserSummaries(r *http.Request) ([]*models.Summary
summaries := make([]*models.Summary, len(intervals))
for i, interval := range intervals {
summary, err := h.summarySrvc.PostProcessWrapped(
h.summarySrvc.Construct(interval[0], interval[1], user, false), // 'to' is always constant
)
summary, err := h.summarySrvc.Aliased(interval[0], interval[1], user, h.summarySrvc.Retrieve)
if err != nil {
return nil, err, http.StatusInternalServerError
}