fix(activity settings): fix saving activity settings

Closes #1251

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2023-06-05 09:23:22 +02:00
parent c8f49e1837
commit 6c1e1e98d8
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773

View file

@ -4,6 +4,7 @@ defmodule Mobilizon.GraphQL.Schema.Users.ActivitySetting do
""" """
use Absinthe.Schema.Notation use Absinthe.Schema.Notation
alias Mobilizon.GraphQL.Resolvers.Users.ActivitySettings alias Mobilizon.GraphQL.Resolvers.Users.ActivitySettings
alias Mobilizon.Users.ActivitySetting
object :activity_setting do object :activity_setting do
meta(:authorize, :user) meta(:authorize, :user)
@ -21,8 +22,9 @@ defmodule Mobilizon.GraphQL.Schema.Users.ActivitySetting do
middleware(Rajska.QueryAuthorization, middleware(Rajska.QueryAuthorization,
permit: :user, permit: :user,
scope: false, scope: ActivitySetting,
rule: :"write:user:setting:activity" rule: :"write:user:setting:activity",
args: %{key: :key}
) )
resolve(&ActivitySettings.upsert_user_activity_setting/3) resolve(&ActivitySettings.upsert_user_activity_setting/3)