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) {
|
func GetThreads(c *gin.Context) {
|
||||||
// TODO: fix empty query
|
pageString := c.DefaultQuery("page", "1")
|
||||||
pageString := c.Query("page")
|
|
||||||
page, err := strconv.Atoi(pageString)
|
page, err := strconv.Atoi(pageString)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println("error:", err)
|
log.Println("error:", err)
|
||||||
|
Loading…
Reference in New Issue
Block a user