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)