Fix unlisted groups being available in search

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2020-12-17 15:25:58 +01:00
parent da564078b3
commit a646d4a40a
9 changed files with 68 additions and 26 deletions

View File

@@ -40,8 +40,13 @@ defmodule Mobilizon.GraphQL.API.Search do
true ->
page =
Actors.build_actors_by_username_or_name_page(
Map.put(args, :term, term),
[result_type],
term,
[
actor_type: [result_type],
radius: Map.get(args, :radius),
location: Map.get(args, :location),
minimum_visibility: :public
],
page,
limit
)

View File

@@ -149,6 +149,7 @@ defmodule Mobilizon.GraphQL.Schema.Actors.GroupType do
enum :group_visibility do
value(:public, description: "Publicly listed and federated")
value(:unlisted, description: "Visible only to people with the link - or invited")
value(:private, description: "Visible only to people with the link - or invited")
end
object :group_queries do
@@ -198,6 +199,11 @@ defmodule Mobilizon.GraphQL.Schema.Actors.GroupType do
default_value: :public
)
arg(:openness, :openness,
default_value: :invite_only,
description: "Whether the group can be join freely, with approval or is invite-only."
)
arg(:avatar, :media_input,
description:
"The avatar for the group, either as an object or directly the ID of an existing media"