use limit from request when getting pageviews

This commit is contained in:
Danny van Kooten 2018-05-03 21:01:51 +02:00
parent 11775e063b
commit 760780f07b
1 changed files with 2 additions and 1 deletions

View File

@ -10,7 +10,8 @@ import (
// URL: /api/pageviews
var GetPageviewsHandler = HandlerFunc(func(w http.ResponseWriter, r *http.Request) error {
before, after := getRequestedPeriods(r)
results, err := count.Pageviews(before, after, defaultLimit)
limit := getRequestedLimit(r)
results, err := count.Pageviews(before, after, limit)
if err != nil {
return err
}