diff options
Diffstat (limited to 'app/controllers/api/companies_controller.rb')
-rw-r--r-- | app/controllers/api/companies_controller.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/api/companies_controller.rb b/app/controllers/api/companies_controller.rb index 19e3493..4c19716 100644 --- a/app/controllers/api/companies_controller.rb +++ b/app/controllers/api/companies_controller.rb @@ -22,7 +22,7 @@ module Api render json: serialized_object.serializable_hash, status: :ok and return if @company.save - render json: { error_messages: @company.errors.full_messages }, status: :unprocessable_entity + render json: { errors: @company.errors.as_json }, status: :unprocessable_entity end def update @@ -33,7 +33,7 @@ module Api if @company.update(permitted_params) render json: serialized_object.serializable_hash, status: :ok else - render json: { error_messages: @company.errors.full_messages }, status: :unprocessable_entity + render json: { errors: @company.errors.as_json }, status: :unprocessable_entity end end |