mirror of
https://github.com/penpot/penpot.git
synced 2025-06-06 16:01:39 +02:00
🐛 Fix files, projects and shared-files queries.
This commit is contained in:
parent
fc01690315
commit
5ae1b72943
4 changed files with 96 additions and 92 deletions
|
@ -273,20 +273,23 @@
|
|||
and m.deleted_at is null) as graphics_count
|
||||
from file as f
|
||||
left join page as pg on (f.id = pg.file_id)
|
||||
where is_shared = true
|
||||
inner join project as p on (p.id = f.project_id)
|
||||
where f.is_shared = true
|
||||
and f.deleted_at is null
|
||||
and pg.deleted_at is null
|
||||
and p.deleted_at is null
|
||||
and p.team_id = ?
|
||||
window pages_w as (partition by f.id order by pg.ordering
|
||||
range between unbounded preceding
|
||||
and unbounded following)
|
||||
order by f.modified_at desc")
|
||||
|
||||
(s/def ::shared-files
|
||||
(s/keys :req-un [::profile-id]))
|
||||
(s/keys :req-un [::profile-id ::team-id]))
|
||||
|
||||
(sq/defquery ::shared-files
|
||||
[{:keys [profile-id] :as params}]
|
||||
(->> (db/exec! db/pool [sql:shared-files])
|
||||
[{:keys [profile-id team-id] :as params}]
|
||||
(->> (db/exec! db/pool [sql:shared-files team-id])
|
||||
(mapv decode-row)))
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue