diff options
Diffstat (limited to 'app/controllers/api/addresses_controller.rb')
-rw-r--r-- | app/controllers/api/addresses_controller.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/api/addresses_controller.rb b/app/controllers/api/addresses_controller.rb index 3319607..e371268 100644 --- a/app/controllers/api/addresses_controller.rb +++ b/app/controllers/api/addresses_controller.rb @@ -32,7 +32,7 @@ module Api begin case @service.call when :not_found - render json: { error_message: 'Not found' }, status: :not_found + render status: :not_found when :unprocessable_entity render json: { error_messages: @service.address.errors.full_messages }, status: :unprocessable_entity else @@ -47,7 +47,7 @@ module Api def destroy @address = current_user_account.addresses.find_by(id: params[:id]) - render json: { error_message: 'Not found' }, status: :not_found and return if @address.nil? + render status: :not_found and return if @address.nil? Services::Addresses::DestroyAddressService.new(current_user_account, params, @address).call render status: :see_other |