include tags in view-snippet

This commit is contained in:
Travis Shears 2025-06-16 11:34:21 +02:00
parent ee1c6a50e9
commit a2352d19c2

View file

@ -22,7 +22,7 @@
(format "(quote (-> (from :snippets [title pub-date tags slug markdown {:xt/id id}]) (order-by {:val pub-date, :dir :desc, :nulls :last}) (offset %s) (limit %s)))" skip limit)))))
(defn get-snippet-by-id [snippet-id]
(first (xt/q client ['#(from :snippets [{:xt/id %} slug title {:xt/id id} markdown pub-date]) snippet-id])))
(first (xt/q client ['#(from :snippets [{:xt/id %} slug title tags {:xt/id id} markdown pub-date]) snippet-id])))
(defn put-snippet [id snippet]
(t/log! {:level :info, :data {:snippet snippet :id id}} "Saving new snippet to db")