Merge pull request #178 from uxbox/fix-search

Fix search
This commit is contained in:
Hirunatan 2020-04-15 10:40:57 +02:00 committed by GitHub
commit 45422722c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 3 deletions

View File

@ -55,10 +55,17 @@
ppr.is_owner = true or ppr.is_owner = true or
ppr.can_edit = true) 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 from file
inner join projects as pr on (file.project_id = pr.id) 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 || '%') 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") order by file.created_at asc")
(s/def ::search-files (s/def ::search-files

View File

@ -148,8 +148,8 @@
on-search-blur on-search-blur
(fn [event] (fn [event]
(let [target (dom/get-target event)] (let [target (dom/get-target event)]
(dom/clean-value! target) (dom/clean-value! target)))
(debounced-emit! (rt/nav :dashboard-team {:team-id team-id})))) ;; (debounced-emit! (rt/nav :dashboard-team {:team-id team-id}))))
on-search-change on-search-change
(fn [event] (fn [event]