use updated-at in filtering and sorting

This commit is contained in:
pablodip 2018-02-02 23:46:09 +01:00
parent e3a9d07add
commit 1b9151e1e1
3 changed files with 5 additions and 7 deletions

View File

@ -422,7 +422,6 @@ SELECT
i.payout_hash AS payout_hash,
i.payout_receipt AS payout_receipt,
i.updated AS updated,
i.created_at AS created_at,
r.owner AS repo_owner,
r.owner_avatar_url AS repo_owner_avatar_url,
r.repo AS repo_name,

View File

@ -155,8 +155,7 @@
:value_usd :value-usd
:claim_count :claim-count
:balance_eth :balance-eth
:user_has_address :user-has-address
:created_at :created-at}]
:user_has_address :user-has-address}]
(map #(-> %
(rename-keys renames)
(update :value-usd usd-decimal->str)

View File

@ -9,7 +9,7 @@
(def bounty-sorting-types-def
{::bounty-sorting-type|most-recent {::bounty-sorting-type.name "Most recent"
::bounty-sorting-type.sort-key-fn (fn [bounty]
(:created-at bounty))
(:updated-at bounty))
::bounty-sorting-type.sort-comparator-fn compare}
::bounty-sorting-type|lowest-value {::bounty-sorting-type.name "Lowest value"
::bounty-sorting-type.sort-key-fn (fn [bounty]
@ -59,9 +59,9 @@
(t/interval filter-from (t/now)))))
(def bounty-filter-type-date-predicate
(fn [filter-value-interval bounty]
(when-let [created-at-inst (:created-at bounty)]
(let [created-at-date (-> created-at-inst inst-ms t-coerce/from-long)]
(t/within? filter-value-interval created-at-date)))))
(when-let [date-inst (:updated-at bounty)]
(let [date (-> date-inst inst-ms t-coerce/from-long)]
(t/within? filter-value-interval date)))))
(def bounty-filter-type-claims-options-def {::bounty-filter-type-claims-option|no-claims "Not claimed yet"})