Improve admin views

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2022-01-13 15:04:43 +01:00
parent d428d1ddf7
commit ca6ef9b06b
13 changed files with 382 additions and 343 deletions

View File

@@ -409,5 +409,22 @@ defmodule Mobilizon.GraphQL.Schema.AdminType do
resolve(&Admin.save_settings/3)
end
@desc """
For an admin to update an user
"""
field :admin_update_user, type: :user do
arg(:id, non_null(:id), description: "The user's ID")
arg(:email, :string, description: "The user's new email")
arg(:confirmed, :string, description: "Manually confirm the user's account")
arg(:role, :user_role, description: "Set user's new role")
arg(:notify, :boolean,
default_value: false,
description: "Whether or not to notify the user of the change"
)
resolve(&Admin.update_user/3)
end
end
end