commit: 589456f0ba6e9700a8a413618f0582e8f63cec2b
parent 4227db08716bf46d677009127438746bd7cd6729
Author: Mark Felder <feld@feld.me>
Date: Tue, 30 Jan 2024 14:14:56 -0500
Revert "Pleroma.Web.AdminAPI.InviteController: dialyzer errors"
This reverts commit db87be126e707ffc84c0b6b598aa07a4b068e82a.
Diffstat:
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/lib/pleroma/web/admin_api/controllers/invite_controller.ex b/lib/pleroma/web/admin_api/controllers/invite_controller.ex
@@ -40,7 +40,7 @@ defmodule Pleroma.Web.AdminAPI.InviteController do
end
@doc "Revokes invite by token"
- def revoke(%{body_params: %{"token" => token}} = conn, _) do
+ def revoke(%{body_params: %{token: token}} = conn, _) do
with {:ok, invite} <- UserInviteToken.find_by_token(token),
{:ok, updated_invite} = UserInviteToken.update_invite(invite, %{used: true}) do
render(conn, "show.json", invite: updated_invite)
@@ -51,7 +51,7 @@ defmodule Pleroma.Web.AdminAPI.InviteController do
end
@doc "Sends registration invite via email"
- def email(%{assigns: %{user: user}, body_params: %{"email" => email} = params} = conn, _) do
+ def email(%{assigns: %{user: user}, body_params: %{email: email} = params} = conn, _) do
with {_, false} <- {:registrations_open, Config.get([:instance, :registrations_open])},
{_, true} <- {:invites_enabled, Config.get([:instance, :invites_enabled])},
{:ok, invite_token} <- UserInviteToken.create_invite(),
@@ -60,7 +60,7 @@ defmodule Pleroma.Web.AdminAPI.InviteController do
|> Pleroma.Emails.UserEmail.user_invitation_email(
invite_token,
email,
- params["name"]
+ params[:name]
)
|> Pleroma.Emails.Mailer.deliver() do
json_response(conn, :no_content, "")
diff --git a/lib/pleroma/web/api_spec/operations/admin/invite_operation.ex b/lib/pleroma/web/api_spec/operations/admin/invite_operation.ex
@@ -79,9 +79,9 @@ defmodule Pleroma.Web.ApiSpec.Admin.InviteOperation do
"Parameters",
%Schema{
type: :object,
- required: ["token"],
+ required: [:token],
properties: %{
- "token" => %Schema{type: :string}
+ token: %Schema{type: :string}
}
},
required: true
@@ -106,10 +106,10 @@ defmodule Pleroma.Web.ApiSpec.Admin.InviteOperation do
"Parameters",
%Schema{
type: :object,
- required: ["email"],
+ required: [:email],
properties: %{
- "email" => %Schema{type: :string, format: :email},
- "name" => %Schema{type: :string}
+ email: %Schema{type: :string, format: :email},
+ name: %Schema{type: :string}
}
},
required: true