Revert "Prep to select more than 1 client"
This reverts commit 085486043f.
This commit is contained in:
@@ -554,7 +554,6 @@
|
||||
|
||||
:profit_and_loss {:type :profit_and_loss_report
|
||||
:args {:client_id {:type :id}
|
||||
:client_ids {:type '(list :id)}
|
||||
:periods {:type '(list :date_range)}}
|
||||
:resolve :get-profit-and-loss}
|
||||
|
||||
|
||||
@@ -183,14 +183,9 @@
|
||||
|
||||
(defn get-profit-and-loss [context args value]
|
||||
(let [client-id (:client_id args)
|
||||
client-ids (or (some-> client-id vector)
|
||||
(:client_ids args))
|
||||
_ (when (not (seq client-ids))
|
||||
(throw (ex-info "Please select a client." {:validation-error "Please select a client."})))
|
||||
_ (doseq [client-id client-ids]
|
||||
(assert-can-see-client (:id context) client-id))
|
||||
all-ledger-entries (full-ledger-for-client (first client-ids))
|
||||
lookup-account (build-account-lookup (first client-ids))]
|
||||
_ (assert-can-see-client (:id context) client-id)
|
||||
all-ledger-entries (full-ledger-for-client client-id)
|
||||
lookup-account (build-account-lookup client-id)]
|
||||
(->graphql
|
||||
{:periods (reduce (fn [acc {:keys [start end]}]
|
||||
(conj acc
|
||||
|
||||
Reference in New Issue
Block a user