From c841174de820c891929b206e3eb2604cb6368ae6 Mon Sep 17 00:00:00 2001 From: Alexander Date: Thu, 26 Dec 2019 10:05:30 +0300 Subject: [PATCH] flag for delete fix --- lib/pleroma/web/admin_api/admin_api_controller.ex | 2 +- test/web/admin_api/admin_api_controller_test.exs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/pleroma/web/admin_api/admin_api_controller.ex b/lib/pleroma/web/admin_api/admin_api_controller.ex index 23dcbedba..d12ed459d 100644 --- a/lib/pleroma/web/admin_api/admin_api_controller.ex +++ b/lib/pleroma/web/admin_api/admin_api_controller.ex @@ -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 diff --git a/test/web/admin_api/admin_api_controller_test.exs b/test/web/admin_api/admin_api_controller_test.exs index d83a95aae..55a4055a7 100644 --- a/test/web/admin_api/admin_api_controller_test.exs +++ b/test/web/admin_api/admin_api_controller_test.exs @@ -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 } ] }) -- 2.45.2