use Pleroma.Web, :view
def render("markers.json", %{markers: markers}) do
- Enum.reduce(markers, %{}, fn m, acc ->
- Map.put_new(acc, m.timeline, %{
- last_read_id: m.last_read_id,
- version: m.lock_version,
- updated_at: NaiveDateTime.to_iso8601(m.updated_at),
- pleroma: %{
- unread_count: m.unread_count
- }
- })
+ Map.new(markers, fn m ->
+ {m.timeline,
+ %{
+ last_read_id: m.last_read_id,
+ version: m.lock_version,
- updated_at: NaiveDateTime.to_iso8601(m.updated_at)
++ updated_at: NaiveDateTime.to_iso8601(m.updated_at),
++ pleroma: %{
++ unread_count: m.unread_count
++ }
+ }}
end)
end
end