summaryrefslogtreecommitdiff
path: root/app/controllers/api/companies_controller.rb
diff options
context:
space:
mode:
authorHombreLaser <sebastian-440@live.com>2023-03-27 20:41:55 -0600
committerHombreLaser <sebastian-440@live.com>2023-03-27 20:41:55 -0600
commitefc5eb10894fc95487c55628b94024e97cd60139 (patch)
tree2e18f71385ce9cc62514ed39b9fbf6420e3ca198 /app/controllers/api/companies_controller.rb
parent35ec25dcb3d57b17a3dc174503b7d20dd4c46e43 (diff)
Añade CardsController
Diffstat (limited to 'app/controllers/api/companies_controller.rb')
-rw-r--r--app/controllers/api/companies_controller.rb8
1 files changed, 2 insertions, 6 deletions
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