user info: add invisible field
This commit is contained in:
parent
1311884a1d
commit
e7333db72a
|
@ -53,6 +53,7 @@ defmodule Pleroma.User.Info do
|
||||||
field(:fields, {:array, :map}, default: nil)
|
field(:fields, {:array, :map}, default: nil)
|
||||||
field(:raw_fields, {:array, :map}, default: [])
|
field(:raw_fields, {:array, :map}, default: [])
|
||||||
field(:discoverable, :boolean, default: false)
|
field(:discoverable, :boolean, default: false)
|
||||||
|
field(:invisible, :boolean, default: false)
|
||||||
|
|
||||||
field(:notification_settings, :map,
|
field(:notification_settings, :map,
|
||||||
default: %{
|
default: %{
|
||||||
|
@ -393,6 +394,14 @@ def set_source_data(info, source_data) do
|
||||||
|> validate_required([:source_data])
|
|> validate_required([:source_data])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def set_invisible(info, invisible) do
|
||||||
|
params = %{invisible: invisible}
|
||||||
|
|
||||||
|
info
|
||||||
|
|> cast(params, [:invisible])
|
||||||
|
|> validate_required([:invisible])
|
||||||
|
end
|
||||||
|
|
||||||
def admin_api_update(info, params) do
|
def admin_api_update(info, params) do
|
||||||
info
|
info
|
||||||
|> cast(params, [
|
|> cast(params, [
|
||||||
|
|
Loading…
Reference in a new issue