mirror of
https://github.com/yanislav-igonin/micrach
synced 2024-12-22 14:22:33 +03:00
fix: pagination count
This commit is contained in:
parent
9b69eb46b7
commit
95bebb01cb
@ -12,6 +12,7 @@ import (
|
||||
)
|
||||
|
||||
func GetThreads(c *gin.Context) {
|
||||
// TODO: fix empty query
|
||||
pageString := c.Query("page")
|
||||
page, err := strconv.Atoi(pageString)
|
||||
if err != nil {
|
||||
@ -34,6 +35,7 @@ func GetThreads(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
// TODO: if page > pagescount render 404
|
||||
data := Repositories.IndexPageData{
|
||||
Threads: threads,
|
||||
PagesCount: int(math.Ceil(float64(count) / 10)),
|
||||
|
Loading…
Reference in New Issue
Block a user