FEATURE: Add search to user bookmark list (#10230)
User bookmarks can now be searched by name or post raw content. The q querystring param is hooked up from the Ember router as well.
This commit is contained in:
@@ -35,6 +35,10 @@ class BookmarkQuery
|
||||
|
||||
results = results.merge(Post.secured(@guardian))
|
||||
|
||||
if @params[:q].present?
|
||||
results = results.where("bookmarks.name ILIKE :q OR posts.raw ILIKE :q", q: "%#{@params[:q]}%")
|
||||
end
|
||||
|
||||
if @page.positive?
|
||||
results = results.offset(@page * @params[:per_page])
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user