mirror of
https://github.com/status-im/open-bounty.git
synced 2025-02-17 03:47:58 +00:00
use updated-at in filtering and sorting
This commit is contained in:
parent
e3a9d07add
commit
1b9151e1e1
@ -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,
|
||||
|
@ -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)
|
||||
|
@ -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"})
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user