From efc5eb10894fc95487c55628b94024e97cd60139 Mon Sep 17 00:00:00 2001 From: HombreLaser Date: Mon, 27 Mar 2023 20:41:55 -0600 Subject: AƱade CardsController MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/api/addresses_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/controllers/api/addresses_controller.rb') 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 -- cgit v1.2.3