🎉 Add comments to dashboard.

This commit is contained in:
Andrey Antukh 2020-11-21 00:14:59 +01:00 committed by Alonso Torres
parent 420294aef4
commit 742af4e066
28 changed files with 968 additions and 438 deletions

View file

@ -193,6 +193,12 @@
inner join file_profile_rel as fpr on (fpr.profile_id = pf.id)
where fpr.file_id = ?
union
select pf.id, pf.fullname, pf.photo
from profile as pf
inner join project_profile_rel as ppr on (ppr.profile_id = pf.id)
inner join file as f on (f.project_id = ppr.project_id)
where f.id = ?
union
select pf.id, pf.fullname, pf.photo
from profile as pf
inner join team_profile_rel as tpr on (tpr.profile_id = pf.id)
@ -202,7 +208,7 @@
(defn retrieve-file-users
[conn id]
(db/exec! conn [sql:file-users id id]))
(db/exec! conn [sql:file-users id id id]))
(s/def ::file-users
(s/keys :req-un [::profile-id ::id]))
@ -215,17 +221,8 @@
;; --- Query: Shared Library Files
;; TODO: remove the counts, because they are no longer needed.
(def ^:private sql:shared-files
"select f.*,
(select count(*) from color as c
where c.file_id = f.id
and c.deleted_at is null) as colors_count,
(select count(*) from media_object as m
where m.file_id = f.id
and m.is_local = false
and m.deleted_at is null) as graphics_count
"select f.*
from file as f
inner join project as p on (p.id = f.project_id)
where f.is_shared = true