From 6c46891ee19f4c6ad8cac3d9b700938c2c8ac8e5 Mon Sep 17 00:00:00 2001 From: Tim Lange Date: Sat, 8 Feb 2020 18:08:37 +0100 Subject: [PATCH] Chore: Remove unnessecary check if object exists (#480) --- .../api/v1/inbox_members_controller.rb | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/app/controllers/api/v1/inbox_members_controller.rb b/app/controllers/api/v1/inbox_members_controller.rb index ed47f409a..982ad00ba 100644 --- a/app/controllers/api/v1/inbox_members_controller.rb +++ b/app/controllers/api/v1/inbox_members_controller.rb @@ -4,17 +4,11 @@ class Api::V1::InboxMembersController < Api::BaseController def create # update also done via same action - if @inbox - begin - update_agents_list - head :ok - rescue StandardError => e - Rails.logger.debug "Rescued: #{e.inspect}" - render_could_not_create_error('Could not add agents to inbox') - end - else - render_not_found_error('Agents or inbox not found') - end + update_agents_list + head :ok + rescue StandardError => e + Rails.logger.debug "Rescued: #{e.inspect}" + render_could_not_create_error('Could not add agents to inbox') end def show