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:
Massedil
2025-07-02 21:22:17 +02:00
parent 88b48f3350
commit 3f078fa96f

View File

@@ -280,12 +280,9 @@ defmodule Mobilizon.GraphQL.Resolvers.Admin do
:ok <- eventually_update_instance_actor(res) do
Config.clear_config_cache()
# add external_urls
urls = Map.get(res, :external_urls, [])
external_urls = Enum.map(urls, &Config.transform_external_url/1)
res = Map.put(res, :external_urls, external_urls)
{:ok, res}
# Return all the admin settings (not only res which is a subpart)
# This way you can update one config value and see other config values
{:ok, Config.admin_settings()}
end
end