split user-bounties function into two
This commit is contained in:
parent
35f9685fad
commit
21da4fb3b4
|
@ -61,18 +61,22 @@
|
|||
github-repos))))
|
||||
|
||||
|
||||
(defn ^:private enrich-owner-bounties [owner-bounty]
|
||||
(let [state (bounties/bounty-state owner-bounty)
|
||||
claims (map
|
||||
#(update % :value_usd usd-decimal->str)
|
||||
(bounties-db/bounty-claims (:issue_id owner-bounty)))]
|
||||
(-> owner-bounty
|
||||
(update :value_usd usd-decimal->str)
|
||||
(assoc :claims claims)
|
||||
(assoc :state state))))
|
||||
|
||||
(defn user-bounties [user]
|
||||
(let [owner-bounties (bounties-db/owner-bounties (:id user))]
|
||||
(into {}
|
||||
(for [ob owner-bounties
|
||||
:let [b (update ob :value_usd usd-decimal->str)]]
|
||||
[(:issue_id b)
|
||||
(conj b
|
||||
(let [claims (map
|
||||
#(update % :value_usd usd-decimal->str)
|
||||
(bounties-db/bounty-claims (:issue_id b)))]
|
||||
{:claims claims}))]))))
|
||||
|
||||
(->> owner-bounties
|
||||
(map enrich-owner-bounties)
|
||||
(map (juxt :issue_id identity))
|
||||
(into {}))))
|
||||
|
||||
(defn top-hunters []
|
||||
(let [renames {:user_name :display-name
|
||||
|
|
Loading…
Reference in New Issue