replace hardcoded list-id 0 values with a named constant

This commit is contained in:
Gered 2016-07-31 14:54:32 -04:00
parent 27cccf5c4f
commit 1b0075cae5
4 changed files with 9 additions and 4 deletions

View file

@ -5,6 +5,7 @@
[webtools.reagent.bootstrap :as bs]
[webtools.reagent.components :refer [->keyed-comps]]
[webtools.cljs.utils :refer [pprint-json]]
[mtgcoll.common :as c]
[mtgcoll.client.page :refer [set-active-breadcrumb!]]
[mtgcoll.client.components.cards :refer [card-list-table ->card-list-pager]]
[mtgcoll.client.components.search :as s]
@ -17,7 +18,7 @@
[]
(let [active-search-filters (r/cursor all-cards-search-filters [:active-filters])
pager (r/cursor all-cards-search-filters [:pager])
list-id 0]
list-id c/owned-list-id]
(fn []
(set-active-breadcrumb! :all)
[:div
@ -35,7 +36,7 @@
(let [fixed-filters [{:field :owned? :value true :comparison :=}]
active-search-filters (r/cursor owned-cards-search-filters [:active-filters])
pager (r/cursor owned-cards-search-filters [:pager])
list-id 0]
list-id c/owned-list-id]
(s/apply-search-filters! owned-cards-search-filters fixed-filters)
(fn []
(set-active-breadcrumb! :owned)

View file

@ -5,6 +5,7 @@
[views.reagent.client.component :as vc :refer [view-cursor] :refer-macros [defvc]]
[webtools.reagent.bootstrap :as bs]
[webtools.cljs.utils :refer [->url]]
[mtgcoll.common :as c]
[mtgcoll.client.page :refer [set-active-breadcrumb!]]
[mtgcoll.client.components.cards :refer [card-list-table ->card-list-pager]]
[mtgcoll.client.components.utils :refer [set-image set-label set-heading th-sortable]]
@ -62,7 +63,7 @@
(let [fixed-filters [{:field :set-code :value set-code :comparison :=}]
active-search-filters (r/cursor set-cards-search-filters [:active-filters])
pager (r/cursor set-cards-search-filters [:pager])
list-id 0]
list-id c/owned-list-id]
(s/apply-search-filters! set-cards-search-filters fixed-filters)
(fn []
[:div.set-cards-list

View file

@ -6,6 +6,7 @@
[webtools.reagent.bootstrap :as bs]
[webtools.reagent.components :refer [->keyed-comps]]
[webtools.cljs.utils :refer [->url]]
[mtgcoll.common :as c]
[mtgcoll.client.auth :as auth]
[mtgcoll.client.page :refer [set-active-breadcrumb!]]
[mtgcoll.client.utils :refer [format-number format-currency get-field-value]]
@ -242,7 +243,7 @@
(let [pricing-sources (view-cursor :pricing-sources)
online? (:online? @settings)
pricing-source (:pricing-source @settings)
list-id 0]
list-id c/owned-list-id]
(set-active-breadcrumb! :stats)
(if (and (not (vc/loading? pricing-sources))
(nil? (:pricing-source @settings)))

View file

@ -1,3 +1,5 @@
(ns mtgcoll.common)
(def max-search-results 1000)
(def owned-list-id 0)