From f2024a314d9115258fe846eabdd3de261668faed Mon Sep 17 00:00:00 2001 From: Roee Gadot Date: Mon, 23 Aug 2021 16:52:07 +0300 Subject: [PATCH] fix GetEntrties ("/entries" endpoint) - working with "tapApi.BaseEntryDetail" (moved from shared) --- agent/pkg/controllers/entries_controller.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/agent/pkg/controllers/entries_controller.go b/agent/pkg/controllers/entries_controller.go index 22c6c8f2f..0b4dfa702 100644 --- a/agent/pkg/controllers/entries_controller.go +++ b/agent/pkg/controllers/entries_controller.go @@ -52,16 +52,16 @@ func GetEntries(c *gin.Context) { utils.ReverseSlice(entries) } - // baseEntries := make([]models.BaseEntryDetails, 0) - // for _, data := range entries { - // harEntry := models.BaseEntryDetails{} - // if err := models.GetEntry(&data, &harEntry); err != nil { - // continue - // } - // baseEntries = append(baseEntries, harEntry) - // } + baseEntries := make([]tapApi.BaseEntryDetails, 0) + for _, data := range entries { + harEntry := tapApi.BaseEntryDetails{} + if err := models.GetEntry(&data, &harEntry); err != nil { + continue + } + baseEntries = append(baseEntries, harEntry) + } - // c.JSON(http.StatusOK, baseEntries) + c.JSON(http.StatusOK, baseEntries) } func GetHARs(c *gin.Context) {