mirror of
https://github.com/yanislav-igonin/micrach
synced 2024-12-22 14:22:33 +03:00
fix: add default query for page
This commit is contained in:
parent
95bebb01cb
commit
1a784118e9
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user