瀏覽代碼

Merge pull request #391 from colin-axner/getCollectionPage-cleanup

update getCollectionPage
pull/393/head
Matt Baer 3 年之前
committed by GitHub
父節點
當前提交
f534ee1dec
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: 4AEE18F83AFDEB23
共有 1 個檔案被更改,包括 6 行新增6 行删除
  1. +6
    -6
      collections.go

+ 6
- 6
collections.go 查看文件

@@ -723,14 +723,14 @@ func newDisplayCollection(c *Collection, cr *collectionReq, page int) *DisplayCo
return coll
}

// getCollectionPage returns the collection page as an int. If the parsed page value is not
// greater than 0 then the default value of 1 is returned.
func getCollectionPage(vars map[string]string) int {
page := 1
var p int
p, _ = strconv.Atoi(vars["page"])
if p > 0 {
page = p
if p, _ := strconv.Atoi(vars["page"]); p > 0 {
return p
}
return page

return 1
}

// handleViewCollection displays the requested Collection


Loading…
取消
儲存