flag for delete fix
This commit is contained in:
parent
0b02040327
commit
c841174de8
@ -815,7 +815,7 @@ def config_update(conn, %{"configs" => configs}) do
|
|||||||
with :ok <- check_dynamic_configuration(conn) do
|
with :ok <- check_dynamic_configuration(conn) do
|
||||||
updated =
|
updated =
|
||||||
Enum.map(configs, fn
|
Enum.map(configs, fn
|
||||||
%{"group" => group, "key" => key, "delete" => "true"} = params ->
|
%{"group" => group, "key" => key, "delete" => true} = params ->
|
||||||
with {:ok, config} <-
|
with {:ok, config} <-
|
||||||
Config.delete(%{group: group, key: key, subkeys: params["subkeys"]}) do
|
Config.delete(%{group: group, key: key, subkeys: params["subkeys"]}) do
|
||||||
config
|
config
|
||||||
|
@ -2330,11 +2330,11 @@ test "update config setting & delete", %{conn: conn} do
|
|||||||
post(conn, "/api/pleroma/admin/config", %{
|
post(conn, "/api/pleroma/admin/config", %{
|
||||||
configs: [
|
configs: [
|
||||||
%{group: config1.group, key: config1.key, value: "another_value"},
|
%{group: config1.group, key: config1.key, value: "another_value"},
|
||||||
%{group: config2.group, key: config2.key, delete: "true"},
|
%{group: config2.group, key: config2.key, delete: true},
|
||||||
%{
|
%{
|
||||||
group: "ueberauth",
|
group: "ueberauth",
|
||||||
key: "Ueberauth.Strategy.Microsoft.OAuth",
|
key: "Ueberauth.Strategy.Microsoft.OAuth",
|
||||||
delete: "true"
|
delete: true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
@ -2741,7 +2741,7 @@ test "delete part of settings by atom subkeys", %{conn: conn} do
|
|||||||
group: config.group,
|
group: config.group,
|
||||||
key: config.key,
|
key: config.key,
|
||||||
subkeys: [":subkey1", ":subkey3"],
|
subkeys: [":subkey1", ":subkey3"],
|
||||||
delete: "true"
|
delete: true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user