Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gab-social
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
gab
social
gab-social
Commits
763a0cb1
Commit
763a0cb1
authored
Jan 13, 2021
by
mgabdev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated SearchService to allow staff to view more content
• Updated: - SearchService to allow staff to view more content
parent
e82f89b7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
app/services/search_service.rb
app/services/search_service.rb
+8
-3
No files found.
app/services/search_service.rb
View file @
763a0cb1
...
...
@@ -4,8 +4,13 @@ class SearchService < BaseService
def
call
(
query
,
account
,
limit
,
options
=
{})
@query
=
query
&
.
strip
@account
=
account
@account
=
account
@options
=
options
@limit
=
limit
.
to_i
if
@account
.
user
.
staff?
@limit
=
100
else
@limit
=
limit
.
to_i
end
@offset
=
options
[
:type
].
blank?
?
0
:
options
[
:offset
].
to_i
@resolve
=
options
[
:resolve
]
||
false
@onlyVerified
=
options
[
:onlyVerified
]
||
false
...
...
@@ -15,8 +20,8 @@ class SearchService < BaseService
if
@query
.
present?
results
[
:accounts
]
=
perform_accounts_search!
if
account_searchable?
results
[
:statuses
]
=
[]
# perform_statuses_search! if full_text_searchable? && !account.nil
?
results
[
:links
]
=
[]
# perform_links_search! if !account.nil
?
results
[
:statuses
]
=
perform_statuses_search!
if
full_text_searchable?
&&
@account
.
user
.
staff
?
results
[
:links
]
=
perform_links_search!
if
@account
.
user
.
staff
?
results
[
:groups
]
=
perform_groups_search!
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment