logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git

invite_view.ex (678B)


  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. defmodule Pleroma.Web.AdminAPI.InviteView do
  5. use Pleroma.Web, :view
  6. def render("index.json", %{invites: invites}) do
  7. %{
  8. invites: render_many(invites, __MODULE__, "show.json", as: :invite)
  9. }
  10. end
  11. def render("show.json", %{invite: invite}) do
  12. %{
  13. "id" => invite.id,
  14. "token" => invite.token,
  15. "used" => invite.used,
  16. "expires_at" => invite.expires_at,
  17. "uses" => invite.uses,
  18. "max_use" => invite.max_use,
  19. "invite_type" => invite.invite_type
  20. }
  21. end
  22. end