Basic ObjectRepresenter.
This commit is contained in:
parent
4a6d48b0fe
commit
42c90855ba
2 changed files with 45 additions and 0 deletions
|
|
@ -0,0 +1,15 @@
|
|||
defmodule Pleroma.Web.TwitterAPI.Representers.ObjectRepresenter do
|
||||
use Pleroma.Web.TwitterAPI.Representers.BaseRepresenter
|
||||
alias Pleroma.Object
|
||||
|
||||
def to_map(%Object{} = object, _opts) do
|
||||
data = object.data
|
||||
url = List.first(data["url"])
|
||||
%{
|
||||
url: url["href"],
|
||||
mimetype: url["mediaType"],
|
||||
id: object.id,
|
||||
oembed: false
|
||||
}
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue