mirror of
https://github.com/1f349/tulip.git
synced 2024-12-22 16:24:10 +00:00
Remove invalid offset error
This commit is contained in:
parent
33b5c99234
commit
6b19e2d4ca
@ -13,16 +13,8 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func (h *HttpServer) ManageAppsGet(rw http.ResponseWriter, req *http.Request, _ httprouter.Params, auth UserAuth) {
|
func (h *HttpServer) ManageAppsGet(rw http.ResponseWriter, req *http.Request, _ httprouter.Params, auth UserAuth) {
|
||||||
offset := 0
|
|
||||||
q := req.URL.Query()
|
q := req.URL.Query()
|
||||||
if q.Has("offset") {
|
offset, _ := strconv.Atoi(q.Get("offset"))
|
||||||
var err error
|
|
||||||
offset, err = strconv.Atoi(q.Get("offset"))
|
|
||||||
if err != nil {
|
|
||||||
http.Error(rw, "400 Bad Request: Invalid offset", http.StatusBadRequest)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var role types.UserRole
|
var role types.UserRole
|
||||||
var appList []database.GetAppListRow
|
var appList []database.GetAppListRow
|
||||||
|
@ -17,16 +17,8 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func (h *HttpServer) ManageUsersGet(rw http.ResponseWriter, req *http.Request, _ httprouter.Params, auth UserAuth) {
|
func (h *HttpServer) ManageUsersGet(rw http.ResponseWriter, req *http.Request, _ httprouter.Params, auth UserAuth) {
|
||||||
offset := 0
|
|
||||||
q := req.URL.Query()
|
q := req.URL.Query()
|
||||||
if q.Has("offset") {
|
offset, _ := strconv.Atoi(q.Get("offset"))
|
||||||
var err error
|
|
||||||
offset, err = strconv.Atoi(q.Get("offset"))
|
|
||||||
if err != nil {
|
|
||||||
http.Error(rw, "400 Bad Request: Invalid offset", http.StatusBadRequest)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var role types.UserRole
|
var role types.UserRole
|
||||||
var userList []database.GetUserListRow
|
var userList []database.GetUserListRow
|
||||||
|
Loading…
Reference in New Issue
Block a user