set bounty page 1 when filters or sorting change

This commit is contained in:
pablodip 2018-01-25 10:06:53 +01:00
parent 161cd7bd99
commit cc1cedbbbd

View File

@ -467,9 +467,12 @@
(reg-event-db
::set-open-bounties-sorting-type
(fn [db [_ sorting-type]]
(assoc db ::db/open-bounties-sorting-type sorting-type)))
(merge db {::db/open-bounties-sorting-type sorting-type
:bounty-page-number 1})))
(reg-event-db
::set-open-bounty-filter-type
(fn [db [_ filter-type filter-value]]
(assoc-in db [::db/open-bounties-filters filter-type] filter-value)))
(-> db
(assoc-in [::db/open-bounties-filters filter-type] filter-value)
(assoc :bounty-page-number 1))))