flag for delete fix
authorAlexander <alex.strizhakov@gmail.com>
Thu, 26 Dec 2019 07:05:30 +0000 (10:05 +0300)
committerAlexander Strizhakov <alex.strizhakov@gmail.com>
Fri, 10 Jan 2020 12:52:02 +0000 (15:52 +0300)
lib/pleroma/web/admin_api/admin_api_controller.ex
test/web/admin_api/admin_api_controller_test.exs

index 23dcbedbacba8cead7068ae585dd4033de214f58..d12ed459d682179020062c1b75f8b7d903147853 100644 (file)
@@ -815,7 +815,7 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIController do
     with :ok <- check_dynamic_configuration(conn) do
       updated =
         Enum.map(configs, fn
-          %{"group" => group, "key" => key, "delete" => "true"} = params ->
+          %{"group" => group, "key" => key, "delete" => true} = params ->
             with {:ok, config} <-
                    Config.delete(%{group: group, key: key, subkeys: params["subkeys"]}) do
               config
index d83a95aae8459c03210957e89403fc83dfc45d01..55a4055a7b1cdc8c58abd668e0eee899940bd68c 100644 (file)
@@ -2330,11 +2330,11 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIControllerTest do
         post(conn, "/api/pleroma/admin/config", %{
           configs: [
             %{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",
               key: "Ueberauth.Strategy.Microsoft.OAuth",
-              delete: "true"
+              delete: true
             }
           ]
         })
@@ -2741,7 +2741,7 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIControllerTest do
               group: config.group,
               key: config.key,
               subkeys: [":subkey1", ":subkey3"],
-              delete: "true"
+              delete: true
             }
           ]
         })