forked from potsda.mn/mobilizon
fix(activity settings): fix saving activity settings
Closes #1251 Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
c8f49e1837
commit
6c1e1e98d8
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue