 (defmethod post-control-event! :saved-project-api-token
   [target message {:keys [project-id api-token]} previous-state current-state]
   (let [project-name (vcs-url/project-name project-id)
-        vcs-type (vcs-url/vcs-type project-id)
         api-ch (get-in current-state [:comms :api])]
     (button-ajax :post
-                 (api-path/project-tokens vcs-type project-name)
+                 (gstring/format "/api/v1/project/%s/token" project-name)
                  :save-project-api-token
                  api-ch
                  :params api-token

                 (gstring/format "/api/v1/project/%s/follow" project)
                 :follow-project
                 api-ch
                 :context {:project-id project-id})
    (analytics/track {:event-type :project-followed
                      :current-state current-state
                      :properties {:org org-name
                                   :repo repo-name}})))


(defmethod post-control-event! :unfollowed-repo

  [_ _ {:keys [login scope]} _ {{api-ch :api} :comms}]
  (api/set-user-admin-scope login scope api-ch))

(defmethod control-event :insights-sorting-changed
  [_ _ {:keys [new-sorting]} state]
  (assoc-in state state/insights-sorting-path new-sorting))
