 
 (defmethod dispatch :network-list
   [_]
-  (fetch "/networks"
+  (fetch (routes/path-for-backend :networks)
          (fn [response]
            (nlist/mount! response))))
 
 (defmethod dispatch :network-info
   [{:keys [route-params]}]
-  (fetch (str "/networks/" (:id route-params))
+  (fetch (routes/path-for-backend :network route-params)
          (fn [response]
            (ninfo/mount! response))))
 


(defmethod dispatch :service-list
  [_]
  (fetch "/services"
         (fn [response]
           (slist/mount! response))))

(defmethod dispatch :service-info
  [{:keys [route-params]}]
  (fetch (str "/services/" (:id route-params))
         (fn [response]
           (sinfo/mount! response))))

(defmethod dispatch :service-create-image
  [_]
  (fetch "/registries/sum"
         (fn [response-reg]
           (fetch "/dockerhub/users/sum"
                  (fn [response-usr]
                    (screatei/mount! response-reg response-usr))))))

(defmethod dispatch :service-create-config
  [_]
  (let [params (keywordize-keys (query->map (query-string)))]
    (screatec/mount! (:registry params)
                     (:repository params))))

(defmethod dispatch :service-edit
  [{:keys [route-params]}]
  (fetch (str "/services/" (:id route-params))
         (fn [response]
           (sedit/mount! response))))



(defmethod dispatch :dockerhub-list
  [_]
  (fetch (routes/path-for-backend :dockerhub-users-sum)
         (fn [response]
           (dhlist/mount! response))))

