fix(backend): Return all the admin settings for saveAdminSettings
Solves the null info returned if we only save a part of the admin settings and requested another part of the admin config as result. For example : save instanceName, and request instanceName and contact in your response. Before : instanceName has the good value, but contact is wrongly null. After : instanceName and contact have the good and updated values.
This commit is contained in:
@@ -280,12 +280,9 @@ defmodule Mobilizon.GraphQL.Resolvers.Admin do
|
|||||||
:ok <- eventually_update_instance_actor(res) do
|
:ok <- eventually_update_instance_actor(res) do
|
||||||
Config.clear_config_cache()
|
Config.clear_config_cache()
|
||||||
|
|
||||||
# add external_urls
|
# Return all the admin settings (not only res which is a subpart)
|
||||||
urls = Map.get(res, :external_urls, [])
|
# This way you can update one config value and see other config values
|
||||||
external_urls = Enum.map(urls, &Config.transform_external_url/1)
|
{:ok, Config.admin_settings()}
|
||||||
res = Map.put(res, :external_urls, external_urls)
|
|
||||||
|
|
||||||
{:ok, res}
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user