mirror of
https://github.com/penpot/penpot.git
synced 2026-09-11 22:49:30 +00:00
✨ Add is-default to nitrate summary (#8814)
This commit is contained in:
parent
1b68318c6b
commit
06aec4b3a3
@ -158,7 +158,7 @@
|
|||||||
;; ---- API: get-teams-summary
|
;; ---- API: get-teams-summary
|
||||||
|
|
||||||
(def ^:private sql:get-teams-summary
|
(def ^:private sql:get-teams-summary
|
||||||
"SELECT t.id, t.name
|
"SELECT t.id, t.name, t.is_default
|
||||||
FROM team AS t
|
FROM team AS t
|
||||||
WHERE t.id = ANY(?)
|
WHERE t.id = ANY(?)
|
||||||
AND t.deleted_at IS NULL;")
|
AND t.deleted_at IS NULL;")
|
||||||
@ -181,7 +181,8 @@
|
|||||||
[:map
|
[:map
|
||||||
[:teams [:vector [:map
|
[:teams [:vector [:map
|
||||||
[:id ::sm/uuid]
|
[:id ::sm/uuid]
|
||||||
[:name ::sm/text]]]]
|
[:name ::sm/text]
|
||||||
|
[:is-default ::sm/boolean]]]]
|
||||||
[:num-files ::sm/int]])
|
[:num-files ::sm/int]])
|
||||||
|
|
||||||
(sv/defmethod ::get-teams-summary
|
(sv/defmethod ::get-teams-summary
|
||||||
@ -204,7 +205,7 @@
|
|||||||
(let [ids-array (db/create-array conn "uuid" ids)
|
(let [ids-array (db/create-array conn "uuid" ids)
|
||||||
teams (db/exec! conn [sql:get-teams-summary ids-array])
|
teams (db/exec! conn [sql:get-teams-summary ids-array])
|
||||||
files-count (-> (db/exec-one! conn [sql:get-files-count ids-array]) :count)]
|
files-count (-> (db/exec-one! conn [sql:get-files-count ids-array]) :count)]
|
||||||
{:teams (mapv #(select-keys % [:id :name]) teams)
|
{:teams teams
|
||||||
:num-files files-count})))))
|
:num-files files-count})))))
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user