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
|
end
|
||||||
|
|
||||||
def fix_attachments(%{"attachment" => attachment} = object) when is_map(attachment) do
|
def fix_attachments(%{"attachment" => attachment} = object) when is_map(attachment) do
|
||||||
attachment =
|
Map.put(object, "attachment", [attachment])
|
||||||
Map.put(attachment, "url", [
|
|> fix_attachments()
|
||||||
%{"type" => "Link", "mediaType" => attachment["mediaType"], "href" => attachment["url"]}
|
|
||||||
])
|
|
||||||
|
|
||||||
Map.put(object, "attachment", attachment)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def fix_attachments(object), do: object
|
def fix_attachments(object), do: object
|
||||||
|
|
Loading…
Reference in a new issue