Made exact match id work better and override everything else
This commit is contained in:
@@ -20,28 +20,31 @@
|
||||
[auto-ap.views.pages.data-page :as data-page]))
|
||||
|
||||
(defn data-params->query-params [params]
|
||||
{:exact-match-id (some-> params :exact-match-id str)
|
||||
:start (:start params 0)
|
||||
:sort (:sort params)
|
||||
:per-page (:per-page params)
|
||||
(if (:exact-match-id params)
|
||||
{:exact-match-id (some-> params :exact-match-id str)
|
||||
:client-id (:id @(re-frame/subscribe [::subs/client]))}
|
||||
{:exact-match-id (some-> params :exact-match-id str)
|
||||
:start (:start params 0)
|
||||
:sort (:sort params)
|
||||
:per-page (:per-page params)
|
||||
|
||||
:vendor-id (:id (:vendor params))
|
||||
:date-range (:date-range params)
|
||||
:due-range (:due-range params)
|
||||
:amount-gte (:amount-gte (:amount-range params))
|
||||
:amount-lte (:amount-lte (:amount-range params))
|
||||
:location (:location params)
|
||||
:unresolved (:unresolved params)
|
||||
:scheduled-payments (:scheduled-payments params)
|
||||
:invoice-number-like (:invoice-number-like params)
|
||||
:client-id (:id @(re-frame/subscribe [::subs/client]))
|
||||
:import-status (:import-status params)
|
||||
:status (condp = @(re-frame/subscribe [::subs/active-page])
|
||||
:invoices nil
|
||||
:import-invoices nil
|
||||
:unpaid-invoices :unpaid
|
||||
:paid-invoices :paid
|
||||
:voided-invoices :voided)})
|
||||
:vendor-id (:id (:vendor params))
|
||||
:date-range (:date-range params)
|
||||
:due-range (:due-range params)
|
||||
:amount-gte (:amount-gte (:amount-range params))
|
||||
:amount-lte (:amount-lte (:amount-range params))
|
||||
:location (:location params)
|
||||
:unresolved (:unresolved params)
|
||||
:scheduled-payments (:scheduled-payments params)
|
||||
:invoice-number-like (:invoice-number-like params)
|
||||
:client-id (:id @(re-frame/subscribe [::subs/client]))
|
||||
:import-status (:import-status params)
|
||||
:status (condp = @(re-frame/subscribe [::subs/active-page])
|
||||
:invoices nil
|
||||
:import-invoices nil
|
||||
:unpaid-invoices :unpaid
|
||||
:paid-invoices :paid
|
||||
:voided-invoices :voided)}))
|
||||
|
||||
(defn query [params]
|
||||
{:venia/queries [[:invoice_page
|
||||
|
||||
Reference in New Issue
Block a user