From b4a547e0aee669640f6d6770a948492ba1967f14 Mon Sep 17 00:00:00 2001 From: kgdev Date: Tue, 19 Jan 2021 22:18:15 +0800 Subject: [PATCH] fix: Incorrect Scoping in Contact API (#1674) --- app/controllers/api/v1/accounts/contacts_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api/v1/accounts/contacts_controller.rb b/app/controllers/api/v1/accounts/contacts_controller.rb index 2ea843f9b..72b343880 100644 --- a/app/controllers/api/v1/accounts/contacts_controller.rb +++ b/app/controllers/api/v1/accounts/contacts_controller.rb @@ -46,7 +46,7 @@ class Api::V1::Accounts::ContactsController < Api::V1::Accounts::BaseController rescue ActiveRecord::RecordInvalid => e render json: { message: e.record.errors.full_messages.join(', '), - contact: Contact.find_by(email: contact_params[:email]) + contact: Current.account.contacts.find_by(email: contact_params[:email]) }, status: :unprocessable_entity end