juzhiyuan commented on a change in pull request #1598:
URL: https://github.com/apache/apisix-dashboard/pull/1598#discussion_r596720207



##########
File path: api/internal/handler/service/service.go
##########
@@ -218,8 +220,34 @@ type BatchDelete struct {
 
 func (h *Handler) BatchDelete(c droplet.Context) (interface{}, error) {
        input := c.Input().(*BatchDelete)
+       ids := strings.Split(input.IDs, ",")
+       mp := make(map[string]struct{})
+       for _, id := range ids {
+               mp[id] = struct{}{}
+       }
+
+       ret, err := h.routeStore.List(c.Context(), store.ListInput{
+               Predicate: func(obj interface{}) bool {
+                       route := obj.(*entity.Route)
+                       if _, exist := 
mp[utils.InterfaceToString(route.ServiceID)]; exist {
+                               return true
+                       }
+
+                       return false
+               },
+               PageSize:   0,
+               PageNumber: 0,

Review comment:
       In restful APIs, when we omit `size` or `number`, it means to fetch all 
resources. If we pass `0`, it should return an empty array IMO.
   
   cc @imjoey @tokers to confirm




----------------------------------------------------------------
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:
[email protected]


Reply via email to