From 2cb26c892a47cbeed02dbceb98a3906fad0048a8 Mon Sep 17 00:00:00 2001 From: Shreya Malviya Date: Wed, 6 Sep 2023 14:55:56 +0530 Subject: [PATCH] UI: Fix JSON content in plugin install/upgrade/uninstall API requests --- .../ui-components/plugins-marketplace/AvailablePlugins.tsx | 2 +- .../ui-components/plugins-marketplace/InstalledPlugins.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/monkey/monkey_island/cc/ui/src/components/ui-components/plugins-marketplace/AvailablePlugins.tsx b/monkey/monkey_island/cc/ui/src/components/ui-components/plugins-marketplace/AvailablePlugins.tsx index f95206d48cc..1968914f0ce 100644 --- a/monkey/monkey_island/cc/ui/src/components/ui-components/plugins-marketplace/AvailablePlugins.tsx +++ b/monkey/monkey_island/cc/ui/src/components/ui-components/plugins-marketplace/AvailablePlugins.tsx @@ -95,7 +95,7 @@ const AvailablePlugins = (props) => { } const installPlugin = (pluginType: string, pluginName: string, pluginVersion: string) => { - let contents = JSON.stringify({plugin_type: pluginType, name: pluginName, version: pluginVersion}); + let contents = {plugin_type: pluginType, name: pluginName, version: pluginVersion}; return IslandHttpClient.putJSON(APIEndpoint.installAgentPlugin, contents, true) } diff --git a/monkey/monkey_island/cc/ui/src/components/ui-components/plugins-marketplace/InstalledPlugins.tsx b/monkey/monkey_island/cc/ui/src/components/ui-components/plugins-marketplace/InstalledPlugins.tsx index 2a79433ff4b..e39f89cc436 100644 --- a/monkey/monkey_island/cc/ui/src/components/ui-components/plugins-marketplace/InstalledPlugins.tsx +++ b/monkey/monkey_island/cc/ui/src/components/ui-components/plugins-marketplace/InstalledPlugins.tsx @@ -51,7 +51,7 @@ const InstalledPlugins = (props) => { }, [installedPlugins, filters]); const uninstallPlugin = (pluginType, pluginName) => { - let contents = JSON.stringify({plugin_type: pluginType, name: pluginName}) + let contents = {plugin_type: pluginType, name: pluginName}; return IslandHttpClient.postJSON(APIEndpoint.uninstallAgentPlugin, contents, true) } @@ -74,7 +74,7 @@ const InstalledPlugins = (props) => { } const upgradePlugin = (pluginType, name, version) => { - let contents = JSON.stringify({plugin_type: pluginType, name: name, version: version}); + let contents = {plugin_type: pluginType, name: name, version: version}; return IslandHttpClient.putJSON(APIEndpoint.installAgentPlugin, contents, true) }