a7ae7c5f71b585916d334e4c1f9f4e53c701e4d2
[anni] / lib / pleroma / web / mastodon_api / views / list_view.ex
1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2022 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