FIX: return 422 for an invalid group name on category create

This commit is contained in:
Blake Erickson
2018-08-30 14:28:40 -06:00
parent 4b6381367e
commit ae532f8548
2 changed files with 14 additions and 0 deletions

View File

@ -134,6 +134,8 @@ class CategoriesController < ApplicationController
else
return render_json_error(@category) unless @category.save
end
rescue ArgumentError => e
render json: { errors: [e.message] }, status: 422
end
def update