fix: Handle Facebook reel attachment type (#13691)
Fixes https://linear.app/chatwoot/issue/PLA-96/argumenterror-reel-is-not-a-valid-file-type-argumenterror Fixes a crash in `when a user shares a Facebook reel via Messenger. Facebook sends these attachments with `type: "reel"`, which isn't a valid `file_type` enum value on the Attachment model (only `ig_reel` exists, matching Instagram's format). --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Sojan Jose <sojan@pepalo.com>
This commit is contained in:
@@ -89,7 +89,7 @@ class Attachment < ApplicationRecord
|
||||
when :embed
|
||||
embed_data
|
||||
else
|
||||
file_metadata
|
||||
file.attached? ? file_metadata : { data_url: external_url, thumb_url: '' }
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user