adds creator.

This commit is contained in:
2022-03-31 07:35:06 -07:00
parent a538cffe6d
commit 7199b9192e
8 changed files with 18 additions and 40 deletions

View File

@@ -24,4 +24,8 @@
{:db/ident :report/url
:db/doc "Where to download the report"
:db/valueType :db.type/string
:db/cardinality :db.cardinality/one}]]}})
:db/cardinality :db.cardinality/one}]]}
::add-creator {:txes [[{:db/ident :report/creator
:db/doc "Creator of the report's name"
:db/valueType :db.type/string
:db/cardinality :db.cardinality/one}]]}})

View File

@@ -25,6 +25,7 @@
(:sort args) (add-sorter-fields {"client" ['[?e :report/client ?c]
'[?c :client/name ?sort-client]]
"created" ['[?e :report/created ?sort-created]]
"creator" ['[?e :report/creator ?sort-creator]]
"name" ['[?e :report/name ?sort-name]
]}
args)
@@ -37,7 +38,7 @@
(apply-pagination args))))
(defn graphql-results [ids db args]
(let [results (->> (d/pull-many db '[:db/id :report/client :report/created :report/url :report/name]
(let [results (->> (d/pull-many db '[:db/id :report/client :report/created :report/url :report/name :report/creator]
ids)
(map #(update % :report/created c/from-date))
(group-by :db/id))]