Add editors count to get-owned-teams rpc method response

This commit is contained in:
Andrey Antukh 2025-06-11 08:40:22 +02:00
parent f02dd9f8dc
commit 71f5806e23
2 changed files with 8 additions and 4 deletions

View file

@ -192,7 +192,8 @@
(def ^:private sql:get-owned-teams
"SELECT t.id, t.name,
(SELECT count(*) FROM team_profile_rel WHERE team_id=t.id) AS total_members
(SELECT count(*) FROM team_profile_rel WHERE team_id=t.id) AS total_members,
(SELECT count(*) FROM team_profile_rel WHERE team_id=t.id AND can_edit=true) AS total_editors
FROM team AS t
JOIN team_profile_rel AS tpr ON (tpr.team_id = t.id)
WHERE t.is_default IS false