|
|
|
@@ -25,7 +25,7 @@ class Projects::ListQuery < ApplicationQuery |
|
|
|
|
|
|
|
def filter_projects(collection) |
|
|
|
# collection = by_pinned(collection) |
|
|
|
collection = by_search(collection) |
|
|
|
collection = by_search(collection) if params[:search].present? |
|
|
|
collection = by_project_type(collection) |
|
|
|
collection = by_project_category(collection) |
|
|
|
collection = by_project_language(collection) |
|
|
|
@@ -33,7 +33,12 @@ class Projects::ListQuery < ApplicationQuery |
|
|
|
end |
|
|
|
|
|
|
|
def by_search(items) |
|
|
|
items.visible.by_name_or_identifier(params[:search]) |
|
|
|
ids = Projects::ElasticsearchService.call(params[:search]) |
|
|
|
if ids.present? |
|
|
|
items.visible.where(id: ids).by_name_or_identifier(params[:search]) |
|
|
|
else |
|
|
|
items.visible.by_name_or_identifier(params[:search]) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
def by_project_type(items) |
|
|
|
|