logo

pleroma

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

rule_view.ex (548B)


  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.RuleView do
  5. use Pleroma.Web, :view
  6. require Pleroma.Constants
  7. def render("index.json", %{rules: rules} = _opts) do
  8. render_many(rules, __MODULE__, "show.json")
  9. end
  10. def render("show.json", %{rule: rule} = _opts) do
  11. %{
  12. id: to_string(rule.id),
  13. priority: rule.priority,
  14. text: rule.text,
  15. hint: rule.hint
  16. }
  17. end
  18. end