diff --git a/src/snippets/infra/db.clj b/src/snippets/infra/db.clj index 8e52d91..537ce1b 100644 --- a/src/snippets/infra/db.clj +++ b/src/snippets/infra/db.clj @@ -41,4 +41,5 @@ (xt/execute-tx client [[:patch-docs :snippets (merge {:xt/id id} patch)]])) (defn list-tags [] - (xt/q client '(-> (from :snippets [{:xt/id id} tags]) (unnest {:tag tags}) (without :tags) (aggregate tag {:ids (array-agg id)})))) + ;; (xt/q client '(-> (from :snippets [{:xt/id id} tags]) (unnest {:tag tags}) (without :tags) (aggregate tag {:ids (array-agg id)})))) + (xt/q client '(-> (from :snippets [{:xt/id id} tags]) (unnest {:tag tags}) (without :tags) (aggregate tag {:count (count id)})))) diff --git a/src/snippets/use_cases/view.clj b/src/snippets/use_cases/view.clj index 2eeba6e..98b66a6 100644 --- a/src/snippets/use_cases/view.clj +++ b/src/snippets/use_cases/view.clj @@ -12,4 +12,4 @@ (defn view-tags [] (t/log! {:level :info} "Viewing tags") - (map #(assoc % :count (count (:ids %))) (db/list-tags))) + (db/list-tags))