Skip to content
Snippets Groups Projects
Unverified Commit 84a5db03 authored by Ahmad Farhat's avatar Ahmad Farhat Committed by GitHub
Browse files

Stopped email search on shared users (#4777)

parent 45e6332d
No related branches found
No related tags found
No related merge requests found
...@@ -50,7 +50,7 @@ module Api ...@@ -50,7 +50,7 @@ module Api
shareable_users = User.with_attached_avatar shareable_users = User.with_attached_avatar
.where.not(id: [@room.shared_users.pluck(:id) << @room.user_id]) .where.not(id: [@room.shared_users.pluck(:id) << @room.user_id])
.where(role_id: [role_ids]) .where(role_id: [role_ids])
.search(params[:search]) .name_search(params[:search])
render_data data: shareable_users, serializer: SharedAccessSerializer, status: :ok render_data data: shareable_users, serializer: SharedAccessSerializer, status: :ok
end end
......
...@@ -65,6 +65,12 @@ class User < ApplicationRecord ...@@ -65,6 +65,12 @@ class User < ApplicationRecord
all all
end end
def self.name_search(input)
return where('users.name ILIKE :input', input: "%#{input}%") if input
all
end
# Verifies the token existence, fetches its user and validates its expiration # Verifies the token existence, fetches its user and validates its expiration
# and invalidates the user token if expired. # and invalidates the user token if expired.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment