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



##########
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:
       You can see here:
   
   
https://github.com/apache/apisix-dashboard/blob/38cf0ba32264d5a7bb4f22bd40ce037e2f66a939/api/internal/core/store/store.go#L210-L225




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


Reply via email to