From 6aa51ea1291a2fdb98058c00587a3b5446c3b6a9 Mon Sep 17 00:00:00 2001 From: valentinkolb Date: Wed, 13 Nov 2024 02:22:56 +0100 Subject: [PATCH] fix(analyticsApi): fixed last_30_days_data (6) --- analyticsApi/main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/analyticsApi/main.go b/analyticsApi/main.go index 82e2ca3..b37166f 100644 --- a/analyticsApi/main.go +++ b/analyticsApi/main.go @@ -124,7 +124,7 @@ func initPageViewCount(app *pocketbase.PocketBase, e *core.ServeEvent) { Last30DaysData []Last30DaysData `json:"last_30_days_data"` } - // Query paginated items, sorted by count + // Query paginated items, retrieving last_30_days_data as a JSON string var rawItems []struct { ID int `json:"id"` Path string `json:"path"` @@ -183,6 +183,7 @@ func initPageViewCount(app *pocketbase.PocketBase, e *core.ServeEvent) { var items []Item for _, rawItem := range rawItems { var last30DaysData []Last30DaysData + logger.LogInfoF("rawItem.Last30DaysData: %v", rawItem.Last30DaysData) if rawItem.Last30DaysData != "" { if err := json.Unmarshal([]byte(rawItem.Last30DaysData), &last30DaysData); err != nil { return apis.NewApiError(500, "Failed to parse last_30_days_data", err)