mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-07-16 23:18:56 +08:00
fixed 项目搜索仅公开项目
This commit is contained in:
@@ -11,7 +11,7 @@ class Projects::ListQuery < ApplicationQuery
|
|||||||
end
|
end
|
||||||
|
|
||||||
def call
|
def call
|
||||||
collection = Project.all
|
collection = Project.visible
|
||||||
collection = filter_projects(collection)
|
collection = filter_projects(collection)
|
||||||
|
|
||||||
sort = params[:sort_by] || "updated_on"
|
sort = params[:sort_by] || "updated_on"
|
||||||
@@ -35,9 +35,9 @@ class Projects::ListQuery < ApplicationQuery
|
|||||||
def by_search(items)
|
def by_search(items)
|
||||||
ids = Projects::ElasticsearchService.call(params[:search])
|
ids = Projects::ElasticsearchService.call(params[:search])
|
||||||
if ids.present?
|
if ids.present?
|
||||||
items.visible.where(id: ids).by_name_or_identifier(params[:search])
|
items.where(id: ids).by_name_or_identifier(params[:search])
|
||||||
else
|
else
|
||||||
items.visible.by_name_or_identifier(params[:search])
|
items.by_name_or_identifier(params[:search])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user