Further simplify changeset logic
This commit is contained in:
parent
f7e59c28ed
commit
63923df0a5
1 changed files with 1 additions and 2 deletions
|
@ -2328,8 +2328,7 @@ defmodule Pleroma.User do
|
||||||
|
|
||||||
@spec approval_changeset(User.t(), keyword()) :: Changeset.t()
|
@spec approval_changeset(User.t(), keyword()) :: Changeset.t()
|
||||||
def approval_changeset(user, set_approval: approved?) do
|
def approval_changeset(user, set_approval: approved?) do
|
||||||
params = if approved?, do: %{is_approved: true}, else: %{is_approved: false}
|
cast(user, %{is_approved: approved?}, [:is_approved])
|
||||||
cast(user, params, [:is_approved])
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def add_pinnned_activity(user, %Pleroma.Activity{id: id}) do
|
def add_pinnned_activity(user, %Pleroma.Activity{id: id}) do
|
||||||
|
|
Loading…
Reference in a new issue