fix: Incorrect Scoping in Contact API (#1674)

This commit is contained in:
kgdev 2021-01-19 22:18:15 +08:00 committed by GitHub
parent 12491fa8d5
commit b4a547e0ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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