Commit 8f57514b authored by mgabdev's avatar mgabdev

Fixed issue with group fetching, serializer for loading password

• Fixed:
- issue with group fetching, serializer for loading password for admin only
parent 7c952a1e
......@@ -61,7 +61,7 @@ class Api::V1::GroupsController < Api::BaseController
end
def show
render json: @group, serializer: REST::GroupSerializer
render json: @group, serializer: REST::GroupSerializer, individual_group: true
end
def create
......
......@@ -20,8 +20,12 @@ class REST::GroupSerializer < ActiveModel::Serializer
return nil
end
if object.group_accounts.where(account_id: current_user.account.id, role: :admin).exists?
object.password
if instance_options[:individual_group]
if object.group_accounts.where(account_id: current_user.account.id, role: :admin).exists?
object.password
else
nil
end
else
nil
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment