From a26469ce2bd045b545dda8fd1fdeeb887f31a976 Mon Sep 17 00:00:00 2001 From: Bryce Covert Date: Fri, 24 Jun 2022 21:08:33 -0700 Subject: [PATCH] Fixes --- src/clj/auto_ap/square/core.clj | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/clj/auto_ap/square/core.clj b/src/clj/auto_ap/square/core.clj index 39709e5d..3ae4359f 100644 --- a/src/clj/auto_ap/square/core.clj +++ b/src/clj/auto_ap/square/core.clj @@ -458,17 +458,24 @@ {:client/square-locations [:db/id :square-location/name :square-location/square-id :square-location/client-location]}]) (defn get-square-clients - ([] (get-square-clients nil)) - ([code] + ([] (d/q '[:find [(pull ?c [:db/id :client/code :client/square-auth-token {:client/square-locations [:db/id :square-location/name :square-location/square-id :square-location/client-location]}]) ...] - :in $ ?code + :in $ + :where [?c :client/square-auth-token]] + (d/db conn))) + ([ & codes] + (d/q '[:find [(pull ?c [:db/id + :client/code + :client/square-auth-token + {:client/square-locations [:db/id :square-location/name :square-location/square-id :square-location/client-location]}]) ...] + :in $ [?code ...] :where [?c :client/square-auth-token] [?c :client/code ?code]] (d/db conn) - code))) + codes))) (defn upsert-locations ([] (doseq [client (get-square-clients)]