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



##########
File path: api/internal/handler/route/route.go
##########
@@ -570,30 +557,26 @@ func (h *Handler) Exist(c droplet.Context) (interface{}, 
error) {
        input := c.Input().(*ExistCheckInput)
        name := input.Name
        exclude := input.Exclude
-       routeStore := store.GetStore(store.HubKeyRoute)
 
-       ret, err := routeStore.List(c.Context(), store.ListInput{
-               Predicate:  nil,
+       ret, err := h.routeStore.List(c.Context(), store.ListInput{
+               Predicate: func(obj interface{}) bool {
+                       r := obj.(*entity.Route)
+                       if r.Name == name && r.ID != exclude {
+                               return true
+                       }
+
+                       return false
+               },
                PageSize:   0,
                PageNumber: 0,
        })
-
        if err != nil {
                return nil, err
        }
 
-       sort := store.NewSort(nil)

Review comment:
       I had checked this. It was still used in upstream.go now. Maybe next 
time we can delete them.




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