1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Web.MastodonAPI.SuggestionView do
7 alias Pleroma.Web.MastodonAPI.AccountView
9 @source_types [:staff, :global, :past_interactions]
11 def render("index.json", %{users: users} = opts) do
12 Enum.map(users, fn user ->
15 |> Map.put(:user, user)
18 render("show.json", opts)
22 def render("show.json", %{source: source, user: _user} = opts) when source in @source_types do
25 account: AccountView.render("show.json", opts)