fixed bug with pageopts
This commit is contained in:
@@ -27,10 +27,10 @@ func pageOptsFromQuery(s *hws.Server, w http.ResponseWriter, r *http.Request) *d
|
||||
}
|
||||
|
||||
func getPageOpts(s *hws.Server, w http.ResponseWriter, r *http.Request, g validation.Getter) *db.PageOpts {
|
||||
page := g.Int("page").Min(1).Value
|
||||
perPage := g.Int("per_page").Min(1).Max(100).Value
|
||||
order := g.String("order").TrimSpace().ToUpper().AllowedValues([]string{"ASC", "DESC"}).Value
|
||||
orderBy := g.String("order_by").TrimSpace().ToLower().Value
|
||||
page := g.Int("page").Optional().Min(1).Value
|
||||
perPage := g.Int("per_page").Optional().Min(1).Max(100).Value
|
||||
order := g.String("order").TrimSpace().ToUpper().Optional().AllowedValues([]string{"ASC", "DESC"}).Value
|
||||
orderBy := g.String("order_by").TrimSpace().Optional().ToLower().Value
|
||||
valid := g.ValidateAndError(s, w, r)
|
||||
if !valid {
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user