should handle case of no payouts.
This commit is contained in:
@@ -430,25 +430,27 @@
|
|||||||
:body
|
:body
|
||||||
:payouts
|
:payouts
|
||||||
(fn [payouts]
|
(fn [payouts]
|
||||||
(->> payouts
|
(if (seq payouts)
|
||||||
(s/->source)
|
(->> payouts
|
||||||
(s/map (fn [payout]
|
(s/->source)
|
||||||
(mu/with-context lc
|
(s/map (fn [payout]
|
||||||
(log/info ::looking-up-payout
|
(mu/with-context lc
|
||||||
:payout-id (:id payout))
|
(log/info ::looking-up-payout
|
||||||
(de/chain
|
:payout-id (:id payout))
|
||||||
(manifold-api-call
|
(de/chain
|
||||||
{:url (str "https://connect.squareup.com/v2/payouts/" (:id payout) "/payout-entries")
|
(manifold-api-call
|
||||||
:method :get
|
{:url (str "https://connect.squareup.com/v2/payouts/" (:id payout) "/payout-entries")
|
||||||
:headers (client-base-headers client "2023-04-19")
|
:method :get
|
||||||
:as :json})
|
:headers (client-base-headers client "2023-04-19")
|
||||||
:body
|
:as :json})
|
||||||
:payout_entries
|
:body
|
||||||
(fn [b]
|
:payout_entries
|
||||||
(assoc payout :payout_entries b))))))
|
(fn [b]
|
||||||
(s/buffer 10)
|
(assoc payout :payout_entries b))))))
|
||||||
(s/realize-each)
|
(s/buffer 10)
|
||||||
(s/reduce conj [])))))))
|
(s/realize-each)
|
||||||
|
(s/reduce conj []))
|
||||||
|
[]))))))
|
||||||
|
|
||||||
(defn transformed-payouts
|
(defn transformed-payouts
|
||||||
([client location]
|
([client location]
|
||||||
|
|||||||
Reference in New Issue
Block a user