Use data from /api/open-bounties (#37)
This commit is contained in:
parent
3d7cf03263
commit
027fe6f2fd
|
@ -158,7 +158,8 @@
|
||||||
(ok (activity-feed)))
|
(ok (activity-feed)))
|
||||||
(GET "/open-bounties" []
|
(GET "/open-bounties" []
|
||||||
(log/debug "/open-bounties")
|
(log/debug "/open-bounties")
|
||||||
(ok (bounties-db/open-bounties)))
|
(ok (map #(update % :balance decimal->str)
|
||||||
|
(bounties-db/open-bounties))))
|
||||||
(context "/user" []
|
(context "/user" []
|
||||||
(GET "/" []
|
(GET "/" []
|
||||||
:auth-rules authenticated?
|
:auth-rules authenticated?
|
||||||
|
|
|
@ -5,19 +5,7 @@
|
||||||
:user nil
|
:user nil
|
||||||
:repos-loading? false
|
:repos-loading? false
|
||||||
:repos {}
|
:repos {}
|
||||||
:open-bounties [{:confirm_hash nil,
|
:open-bounties []
|
||||||
:issue_id 207799767,
|
|
||||||
:issue_number 19,
|
|
||||||
:repo_name "commiteth",
|
|
||||||
:updated #inst "2017-03-16T18:32:43.113-00:00",
|
|
||||||
:issue_title "Estimate gas instead of hard-coding",
|
|
||||||
:repo_owner "status-im",
|
|
||||||
:repo_owner_avatar_url "https://avatars2.githubusercontent.com/u/11767950?v=3"
|
|
||||||
:balance 0.0M,
|
|
||||||
:payout_receipt nil,
|
|
||||||
:repo_id 65593470,
|
|
||||||
:contract_address "0xaf77604e06169b210158f00ad4d3ef028aecded9",
|
|
||||||
:payout_hash nil}]
|
|
||||||
:owner-bounties {}
|
:owner-bounties {}
|
||||||
:top-hunters []
|
:top-hunters []
|
||||||
:activity-feed []})
|
:activity-feed []})
|
||||||
|
|
|
@ -96,6 +96,19 @@
|
||||||
(fn [db [_ activity-feed]]
|
(fn [db [_ activity-feed]]
|
||||||
(assoc db :activity-feed activity-feed)))
|
(assoc db :activity-feed activity-feed)))
|
||||||
|
|
||||||
|
(reg-event-fx
|
||||||
|
:load-open-bounties
|
||||||
|
(fn [{:keys [db]} [_]]
|
||||||
|
{:db db
|
||||||
|
:http {:method GET
|
||||||
|
:url "/api/open-bounties"
|
||||||
|
:on-success #(dispatch [:set-open-bounties %])}}))
|
||||||
|
|
||||||
|
(reg-event-db
|
||||||
|
:set-open-bounties
|
||||||
|
(fn [db [_ issues]]
|
||||||
|
(assoc db :open-bounties issues)))
|
||||||
|
|
||||||
|
|
||||||
(reg-event-fx
|
(reg-event-fx
|
||||||
:load-owner-bounties
|
:load-owner-bounties
|
||||||
|
@ -125,7 +138,8 @@
|
||||||
{:db
|
{:db
|
||||||
(assoc db :user (:user user-profile))
|
(assoc db :user (:user user-profile))
|
||||||
:dispatch-n [[:load-user-repos]
|
:dispatch-n [[:load-user-repos]
|
||||||
[:load-owner-bounties]]}))
|
[:load-owner-bounties]
|
||||||
|
[:load-open-bounties]]}))
|
||||||
|
|
||||||
(reg-event-db
|
(reg-event-db
|
||||||
:clear-repos-loading
|
:clear-repos-loading
|
||||||
|
|
Loading…
Reference in New Issue