chore: fix the failing user destroy for admin (#3223)
- fix the invitee association on the user - handle Instagram events with inbox missing
This commit is contained in:
@@ -17,6 +17,9 @@ class Instagram::MessageText < Instagram::WebhooksBaseService
|
||||
[@messaging[:recipient][:id], @messaging[:sender][:id]]
|
||||
end
|
||||
inbox_channel(instagram_id)
|
||||
# person can connect the channel and then delete the inbox
|
||||
return if @inbox.blank?
|
||||
|
||||
ensure_contact(contact_id)
|
||||
|
||||
create_message
|
||||
|
||||
@@ -3,7 +3,7 @@ class Instagram::WebhooksBaseService
|
||||
|
||||
def inbox_channel(instagram_id)
|
||||
messenger_channel = Channel::FacebookPage.where(instagram_id: instagram_id)
|
||||
@inbox = ::Inbox.find_by!(channel: messenger_channel)
|
||||
@inbox = ::Inbox.find_by(channel: messenger_channel)
|
||||
end
|
||||
|
||||
def find_or_create_contact(user)
|
||||
|
||||
Reference in New Issue
Block a user