parent
17eed16dfe
commit
c36b4279ac
1 changed files with 4 additions and 3 deletions
|
@ -10,7 +10,8 @@ module Api
|
||||||
begin
|
begin
|
||||||
update_agents_list
|
update_agents_list
|
||||||
head :ok
|
head :ok
|
||||||
rescue StandardError
|
rescue StandardError => e
|
||||||
|
Rails.logger.debug "Rescued: #{e.inspect}"
|
||||||
render_could_not_create_error('Could not add agents to inbox')
|
render_could_not_create_error('Could not add agents to inbox')
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
@ -31,7 +32,7 @@ module Api
|
||||||
# the new ones are the agents which are to be added to 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_added_ids.each { |user_id| @inbox.add_member(user_id) }
|
||||||
agents_to_be_removed_ids.each { |_user_id| @inbox.remove_member(user) }
|
agents_to_be_removed_ids.each { |user_id| @inbox.remove_member(user_id) }
|
||||||
end
|
end
|
||||||
|
|
||||||
def agents_to_be_added_ids
|
def agents_to_be_added_ids
|
||||||
|
@ -43,7 +44,7 @@ module Api
|
||||||
end
|
end
|
||||||
|
|
||||||
def current_agents_ids
|
def current_agents_ids
|
||||||
@current_agents_ids = @inbox.members.pluck(:user_id)
|
@current_agents_ids = @inbox.members.pluck(:id)
|
||||||
end
|
end
|
||||||
|
|
||||||
def fetch_inbox
|
def fetch_inbox
|
||||||
|
|
Loading…
Reference in a new issue