From: Alexander Date: Thu, 26 Dec 2019 07:05:30 +0000 (+0300) Subject: flag for delete fix X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=c841174de820c891929b206e3eb2604cb6368ae6;p=akkoma flag for delete fix --- 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 } ] })