mirror of
https://github.com/penpot/penpot.git
synced 2025-06-07 21:51:40 +02:00
🐛 Fixes dashboard file search
This commit is contained in:
parent
558bcc07b2
commit
609eb4f342
1 changed files with 6 additions and 13 deletions
|
@ -64,19 +64,12 @@
|
||||||
where p.team_id = uuid_nil()
|
where p.team_id = uuid_nil()
|
||||||
and p.deleted_at is null
|
and p.deleted_at is null
|
||||||
)
|
)
|
||||||
select distinct
|
select distinct f.*
|
||||||
file.*,
|
from file as f
|
||||||
array_agg(page.id) over pages_w as pages,
|
inner join projects as pr on (f.project_id = pr.id)
|
||||||
first_value(page.data) over pages_w as data
|
where f.name ilike ('%' || ? || '%')
|
||||||
from file
|
and f.deleted_at is null
|
||||||
inner join projects as pr on (file.project_id = pr.id)
|
order by f.created_at asc")
|
||||||
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")
|
|
||||||
|
|
||||||
(s/def ::search-files
|
(s/def ::search-files
|
||||||
(s/keys :req-un [::profile-id ::team-id ::search-term]))
|
(s/keys :req-un [::profile-id ::team-id ::search-term]))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue