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

fix: postprocessing for alias keys not corresponding to an actual entity

This commit is contained in:
Ferdinand Mütsch 2020-11-01 13:09:39 +01:00
parent c2d30826f6
commit 68e66298b8
2 changed files with 9 additions and 1 deletions

View File

@ -189,6 +189,14 @@ func (srv *SummaryService) PostProcess(summary *models.Summary) *models.Summary
if key, _ := srv.AliasService.GetAliasOrDefault(summary.UserID, item.Type, item.Key); key != item.Key {
if targetItem := findItem(key); targetItem != nil {
targetItem.Total += item.Total
} else {
target = append(target, &models.SummaryItem{
ID: item.ID,
SummaryID: item.SummaryID,
Type: item.Type,
Key: key,
Total: item.Total,
})
}
}
}

View File

@ -1 +1 @@
1.13.1
1.13.2