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



##########
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:
       We need to list all routes.




----------------------------------------------------------------
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