Chore: Remove unnessecary check if object exists (#480)
This commit is contained in:
parent
67e41092e6
commit
6c46891ee1
1 changed files with 5 additions and 11 deletions
|
@ -4,18 +4,12 @@ class Api::V1::InboxMembersController < Api::BaseController
|
||||||
|
|
||||||
def create
|
def create
|
||||||
# update also done via same action
|
# update also done via same action
|
||||||
if @inbox
|
|
||||||
begin
|
|
||||||
update_agents_list
|
update_agents_list
|
||||||
head :ok
|
head :ok
|
||||||
rescue StandardError => e
|
rescue StandardError => e
|
||||||
Rails.logger.debug "Rescued: #{e.inspect}"
|
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
|
|
||||||
render_not_found_error('Agents or inbox not found')
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@agents = current_account.users.where(id: @inbox.members.pluck(:user_id))
|
@agents = current_account.users.where(id: @inbox.members.pluck(:user_id))
|
||||||
|
|
Loading…
Reference in a new issue