diff options
Diffstat (limited to 'app/controllers/api/products_controller.rb')
-rw-r--r-- | app/controllers/api/products_controller.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/api/products_controller.rb b/app/controllers/api/products_controller.rb index 5ebd6b6..2fa435d 100644 --- a/app/controllers/api/products_controller.rb +++ b/app/controllers/api/products_controller.rb @@ -21,7 +21,7 @@ module Api if @product.save render json: serialized_object(@product.public_id).serializable_hash, status: :ok else - render json: { error_messages: @product.errors.full_messages }, status: :unprocessable_entity + render json: { errors: @product.errors.as_json }, status: :unprocessable_entity end end @@ -33,7 +33,7 @@ module Api if @product.update(object_params) render json: serialized_object(@product.public_id).serializable_hash, status: :ok else - render json: { error_messages: @product.errors.full_messages }, status: :unprocessable_entity + render json: { errors: @product.errors.as_json }, status: :unprocessable_entity end end |