Show bubble_timeline in the api if any instances are set in it, do not show if none...
[akkoma] / lib / pleroma / web / mastodon_api / views / list_view.ex
1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
4
5 defmodule Pleroma.Web.MastodonAPI.ListView do
6 use Pleroma.Web, :view
7 alias Pleroma.Web.MastodonAPI.ListView
8
9 def render("index.json", %{lists: lists} = opts) do
10 render_many(lists, ListView, "show.json", opts)
11 end
12
13 def render("show.json", %{list: list}) do
14 %{
15 id: to_string(list.id),
16 title: list.title
17 }
18 end
19 end