forked from AkkomaGang/akkoma
transmogrifier: Just make attachement maps into a list and reroll
This commit is contained in:
parent
e53da692fb
commit
9446b02bdf
1 changed files with 2 additions and 6 deletions
|
@ -159,12 +159,8 @@ def fix_attachments(%{"attachment" => attachment} = object) when is_list(attachm
|
|||
end
|
||||
|
||||
def fix_attachments(%{"attachment" => attachment} = object) when is_map(attachment) do
|
||||
attachment =
|
||||
Map.put(attachment, "url", [
|
||||
%{"type" => "Link", "mediaType" => attachment["mediaType"], "href" => attachment["url"]}
|
||||
])
|
||||
|
||||
Map.put(object, "attachment", attachment)
|
||||
Map.put(object, "attachment", [attachment])
|
||||
|> fix_attachments()
|
||||
end
|
||||
|
||||
def fix_attachments(object), do: object
|
||||
|
|
Loading…
Reference in a new issue