feat(analyticsApi): modified sort
Build and Push Docker image / build-and-push (push) Successful in 2m7s Details

This commit is contained in:
Valentin Kolb 2024-11-13 01:14:18 +01:00
parent fe232533c3
commit 72cfd2ba59
1 changed files with 2 additions and 2 deletions

View File

@ -123,7 +123,7 @@ func initPageViewCount(app *pocketbase.PocketBase, e *core.ServeEvent) {
Last30DaysData []Last30DaysData `json:"last_30_days_data"`
}
// Query paginated items
// Query paginated items, sorted by count
var items []Item
err = app.Dao().DB().
NewQuery(`
@ -158,7 +158,7 @@ func initPageViewCount(app *pocketbase.PocketBase, e *core.ServeEvent) {
GROUP BY
view.path
ORDER BY
path ` + sort + `
count ` + sort + `
LIMIT {:perPage} OFFSET {:offset}
`).
Bind(dbx.Params{