fix: add default query for page

This commit is contained in:
Yanislav Igonin 2021-09-10 15:06:37 +03:00
parent 95bebb01cb
commit 1a784118e9

View File

@ -12,8 +12,7 @@ import (
)
func GetThreads(c *gin.Context) {
// TODO: fix empty query
pageString := c.Query("page")
pageString := c.DefaultQuery("page", "1")
page, err := strconv.Atoi(pageString)
if err != nil {
log.Println("error:", err)