starsz commented on a change in pull request #1207: URL: https://github.com/apache/apisix-dashboard/pull/1207#discussion_r551761963
########## File path: api/internal/handler/route/route.go ########## @@ -218,7 +220,11 @@ func (h *Handler) List(c droplet.Context) (interface{}, error) { if input.Label != "" && !utils.LabelContains(obj.(*entity.Route).Labels, labelMap) { return false } - + + status, _ := strconv.Atoi(input.Status) Review comment: Hi, I think this can be done before the `List` function. And we need to check the error. Return `400` if err is not nil. ########## File path: api/internal/handler/route/route.go ########## @@ -218,7 +220,11 @@ func (h *Handler) List(c droplet.Context) (interface{}, error) { if input.Label != "" && !utils.LabelContains(obj.(*entity.Route).Labels, labelMap) { return false } - + + status, _ := strconv.Atoi(input.Status) + if input.Status != "" && uint8(obj.(*entity.Route).Status) != uint8(status) { Review comment: There is an easy way.Just compare `strconv.Itoa(int(obj.(*entity.Route).Status))` and status. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org