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