Implement client ban and unban endpoints
This commit is contained in:
parent
bb7c3b07e9
commit
2088f0a869
5 changed files with 139 additions and 3 deletions
20
lib/matrix_server_web/client/request/ban.ex
Normal file
20
lib/matrix_server_web/client/request/ban.ex
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue