Implement client ban and unban endpoints

This commit is contained in:
Pim Kunis 2021-08-26 22:09:45 +02:00
parent bb7c3b07e9
commit 2088f0a869
5 changed files with 139 additions and 3 deletions

View file

@ -0,0 +1,20 @@
defmodule MatrixServerWeb.Client.Request.Ban do
use MatrixServerWeb.Request
@type t :: %__MODULE__{
user_id: String.t(),
reason: String.t() | nil
}
@primary_key false
embedded_schema do
field :user_id, :string
field :reason, :string
end
def changeset(data, params) do
data
|> cast(params, [:user_id, :reason])
|> validate_required([:user_id])
end
end