0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-19 11:11:21 -05:00

🐛 Fixes dashboard file search

This commit is contained in:
alonso.torres 2020-09-17 16:09:35 +02:00 committed by Andrey Antukh
parent 558bcc07b2
commit 609eb4f342

View file

@ -64,19 +64,12 @@
where p.team_id = uuid_nil()
and p.deleted_at is null
)
select distinct
file.*,
array_agg(page.id) over pages_w as pages,
first_value(page.data) over pages_w as data
from file
inner join projects as pr on (file.project_id = pr.id)
left join page on (file.id = page.file_id)
where file.name ilike ('%' || ? || '%')
and file.deleted_at is null
window pages_w as (partition by file.id order by page.created_at
range between unbounded preceding
and unbounded following)
order by file.created_at asc")
select distinct f.*
from file as f
inner join projects as pr on (f.project_id = pr.id)
where f.name ilike ('%' || ? || '%')
and f.deleted_at is null
order by f.created_at asc")
(s/def ::search-files
(s/keys :req-un [::profile-id ::team-id ::search-term]))