chore: Update method for team members (#1734)

Co-authored-by: Sojan Jose <sojan@pepalo.com>
This commit is contained in:
Nithin David Thomas
2021-02-09 19:21:31 +05:30
committed by GitHub
parent bf2b56a988
commit 1484849cc7
6 changed files with 76 additions and 9 deletions

View File

@@ -22,9 +22,10 @@ class Api::V1::Accounts::InboxMembersController < Api::V1::Accounts::BaseControl
# get the list of user_ids from params
# the missing ones are the agents which are to be deleted from the inbox
# the new ones are the agents which are to be added to the inbox
agents_to_be_added_ids.each { |user_id| @inbox.add_member(user_id) }
agents_to_be_removed_ids.each { |user_id| @inbox.remove_member(user_id) }
ActiveRecord::Base.transaction do
agents_to_be_added_ids.each { |user_id| @inbox.add_member(user_id) }
agents_to_be_removed_ids.each { |user_id| @inbox.remove_member(user_id) }
end
end
def agents_to_be_added_ids