From efc5eb10894fc95487c55628b94024e97cd60139 Mon Sep 17 00:00:00 2001 From: HombreLaser Date: Mon, 27 Mar 2023 20:41:55 -0600 Subject: Añade CardsController MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/api/companies_controller.rb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'app/controllers/api/companies_controller.rb') diff --git a/app/controllers/api/companies_controller.rb b/app/controllers/api/companies_controller.rb index 973eedb..b79c58b 100644 --- a/app/controllers/api/companies_controller.rb +++ b/app/controllers/api/companies_controller.rb @@ -14,7 +14,7 @@ module Api render json: serialized_object.serializable_hash, status: :ok and return if @company - render json: not_found_error_message, status: :not_found + render status: :not_found end def create @@ -28,7 +28,7 @@ module Api def update @company = Company.find_by(short_name: params[:id]) - render json: not_found_error_message, status: :not_found and return if @company.nil? + render status: :not_found and return if @company.nil? if @company.update(permitted_params) render json: serialized_object.serializable_hash, status: :ok @@ -50,9 +50,5 @@ module Api def permitted_params params.permit(:name, :country, :short_name, :logo) end - - def not_found_error_message - { error_message: "No se encontró la compañía #{params[:short_name]}" } - end end end -- cgit v1.2.3