aboutsummaryrefslogtreecommitdiff
path: root/client.go
diff options
context:
space:
mode:
authorFChannel <=>2021-01-30 01:47:26 -0800
committerFChannel <=>2021-01-30 01:47:26 -0800
commitf0afe325423011a8cb4eed5192375fcae5312da3 (patch)
tree7baf99ca88d29de781c576ab55623650594bea2d /client.go
parent2fdaf020b1d952a9c86863c380affceb9ac09c61 (diff)
fix for pagnation
Diffstat (limited to 'client.go')
-rw-r--r--client.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/client.go b/client.go
index f0a3ed7..9c9ce9c 100644
--- a/client.go
+++ b/client.go
@@ -7,7 +7,6 @@ import "database/sql"
import _ "github.com/lib/pq"
import "strings"
import "strconv"
-import "math"
import "sort"
import "regexp"
import "io/ioutil"
@@ -183,7 +182,7 @@ func OutboxGet(w http.ResponseWriter, r *http.Request, db *sql.DB, collection Co
var orderedReplies []ObjectBase
for i := 0; i < 5; i++ {
cur := len(replies) - i - 1
- if cur > -1 {
+ if cur > - 1 {
orderedReplies = append(orderedReplies, replies[cur])
}
}
@@ -199,8 +198,8 @@ func OutboxGet(w http.ResponseWriter, r *http.Request, db *sql.DB, collection Co
}
var pages []int
- pageLimit := math.Round(float64(len(mergeCollection.OrderedItems) / offset))
- for i := 0.0; i <= pageLimit; i++ {
+ pageLimit := (float64(len(mergeCollection.OrderedItems)) / float64(offset))
+ for i := 0.0; i < pageLimit; i++ {
pages = append(pages, int(i))
}