Use data from /api/open-bounties (#37)

This commit is contained in:
Teemu Patja 2017-03-17 23:42:03 +02:00
parent 3d7cf03263
commit 027fe6f2fd
No known key found for this signature in database
GPG Key ID: F5B7035E6580FD4C
3 changed files with 18 additions and 15 deletions

View File

@ -158,7 +158,8 @@
(ok (activity-feed)))
(GET "/open-bounties" []
(log/debug "/open-bounties")
(ok (bounties-db/open-bounties)))
(ok (map #(update % :balance decimal->str)
(bounties-db/open-bounties))))
(context "/user" []
(GET "/" []
:auth-rules authenticated?

View File

@ -5,19 +5,7 @@
:user nil
:repos-loading? false
:repos {}
:open-bounties [{:confirm_hash nil,
: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}]
:open-bounties []
:owner-bounties {}
:top-hunters []
:activity-feed []})

View File

@ -96,6 +96,19 @@
(fn [db [_ 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
:load-owner-bounties
@ -125,7 +138,8 @@
{:db
(assoc db :user (:user user-profile))
:dispatch-n [[:load-user-repos]
[:load-owner-bounties]]}))
[:load-owner-bounties]
[:load-open-bounties]]}))
(reg-event-db
:clear-repos-loading