summaryrefslogtreecommitdiff
path: root/app/controllers/api/user_accounts_controller.rb
diff options
context:
space:
mode:
authorHombreLaser <sebastian-440@live.com>2023-04-04 17:55:20 -0600
committerHombreLaser <sebastian-440@live.com>2023-04-04 17:55:20 -0600
commitdb9b4b712271a67e60e6c0bf58c9ce510f177682 (patch)
tree791da60f29a1ac3b73efff46493d96c0116318e0 /app/controllers/api/user_accounts_controller.rb
parent3afd35371caa0677fd2f66491bd337d1673013dc (diff)
Mejora presentaciĆ³n de mensajes de error
Diffstat (limited to 'app/controllers/api/user_accounts_controller.rb')
-rw-r--r--app/controllers/api/user_accounts_controller.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/api/user_accounts_controller.rb b/app/controllers/api/user_accounts_controller.rb
index ad276b5..6404dee 100644
--- a/app/controllers/api/user_accounts_controller.rb
+++ b/app/controllers/api/user_accounts_controller.rb
@@ -14,14 +14,14 @@ module Api
render json: generate_token, status: :ok and return if @user_account.save
- render json: @user_account.errors.full_messages, status: :unprocessable_entity
+ render json: { errors: @user_account.errors.as_json }, status: :unprocessable_entity
end
def update
if current_user_account.update(permitted_params)
render json: serialized_object.serializable_hash, status: :ok
else
- render json: current_user_account.errors.full_messages, status: :unprocessable_entity
+ render json: { errors: current_user_account.errors.as_json }, status: :unprocessable_entity
end
end