From 3f078fa96fb06f3e96068a2035315fdd159353a8 Mon Sep 17 00:00:00 2001 From: Massedil Date: Wed, 2 Jul 2025 21:22:17 +0200 Subject: [PATCH] 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. --- lib/graphql/resolvers/admin.ex | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/graphql/resolvers/admin.ex b/lib/graphql/resolvers/admin.ex index 772ae944d..15f1e2fc1 100644 --- a/lib/graphql/resolvers/admin.ex +++ b/lib/graphql/resolvers/admin.ex @@ -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