0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-16 01:31:22 -05:00

🐛 Retrieve complete information for files in dashboard search

This commit is contained in:
Andrés Moya 2020-04-15 10:03:54 +02:00
parent 07fb644e07
commit ce37b46de0

View file

@ -55,10 +55,17 @@
ppr.is_owner = true or
ppr.can_edit = true)
)
select file.*
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 ('%' || $3 || '%')
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")
(s/def ::search-files