Only request user repos when admin token available
This commit is contained in:
parent
d6aaa2dcea
commit
2a05a6bef7
|
@ -213,14 +213,15 @@
|
||||||
(reg-event-fx
|
(reg-event-fx
|
||||||
:load-user-repos
|
:load-user-repos
|
||||||
(fn [{:keys [db]} [_]]
|
(fn [{:keys [db]} [_]]
|
||||||
{:db (assoc db :repos-loading? true)
|
(conj {:db (assoc db :repos-loading? true)}
|
||||||
:http {:method GET
|
(when-let [token (get-admin-token db)]
|
||||||
:url "/api/user/repositories"
|
:http {:method GET
|
||||||
:params {:token (get-admin-token db)}
|
:url "/api/user/repositories"
|
||||||
:on-success #(dispatch [:set-user-repos (:repositories %)])
|
:params {:token token}
|
||||||
:on-error #(dispatch [:set-flash-message
|
:on-success #(dispatch [:set-user-repos (:repositories %)])
|
||||||
:error "Failed to load repositories"])
|
:on-error #(dispatch [:set-flash-message
|
||||||
:finally #(dispatch [:clear-repos-loading])}}))
|
:error "Failed to load repositories"])
|
||||||
|
:finally #(dispatch [:clear-repos-loading])}))))
|
||||||
|
|
||||||
|
|
||||||
(defn update-repo-state [all-repos full-name data]
|
(defn update-repo-state [all-repos full-name data]
|
||||||
|
|
Loading…
Reference in New Issue