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

update getCollectionPage
pull/393/head
Matt Baer 4 years ago committed by GitHub
commit f534ee1dec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      collections.go

@ -723,14 +723,14 @@ func newDisplayCollection(c *Collection, cr *collectionReq, page int) *DisplayCo
return coll 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 { func getCollectionPage(vars map[string]string) int {
page := 1 if p, _ := strconv.Atoi(vars["page"]); p > 0 {
var p int return p
p, _ = strconv.Atoi(vars["page"])
if p > 0 {
page = p
} }
return page
return 1
} }
// handleViewCollection displays the requested Collection // handleViewCollection displays the requested Collection

Loading…
Cancel
Save