diff --git a/src/components/AddOn/core/AddOnStore/AddOnStore.tsx b/src/components/AddOn/core/AddOnStore/AddOnStore.tsx index 1f2ad1f6d5..87bd30b93c 100644 --- a/src/components/AddOn/core/AddOnStore/AddOnStore.tsx +++ b/src/components/AddOn/core/AddOnStore/AddOnStore.tsx @@ -47,7 +47,6 @@ function addOnStore(): JSX.Element { const { data, loading } = useQuery<{ getPlugins: InterfacePluginHelper[] }>( PLUGIN_GET, ); - console.log(data); const { orgId } = useParams<{ orgId: string }>(); @@ -71,8 +70,8 @@ function addOnStore(): JSX.Element { * Sets the list of installed plugins in the component's state. */ /* istanbul ignore next */ - const getInstalledPlugins: () => any = () => { - setDataList(data); + const getInstalledPlugins: () => void = () => { + setDataList(data?.getPlugins ?? []); }; /** @@ -83,7 +82,11 @@ function addOnStore(): JSX.Element { const updateSelectedTab = (tab: any): void => { setIsStore(tab === 'available'); /* istanbul ignore next */ - isStore ? getStorePlugins() : getInstalledPlugins(); + if (isStore) { + getStorePlugins(); + } else { + getInstalledPlugins(); + } }; /** diff --git a/src/components/AddOn/support/services/Plugin.helper.ts b/src/components/AddOn/support/services/Plugin.helper.ts index 4462cdd418..1ebefc351f 100644 --- a/src/components/AddOn/support/services/Plugin.helper.ts +++ b/src/components/AddOn/support/services/Plugin.helper.ts @@ -20,7 +20,7 @@ class PluginHelper { */ fetchInstalled = async (): Promise => { const result = await fetch(`http://localhost:3005/installed`); - return (await result.json()) as InterfacePluginHelper[]; + return await result.json(); }; /** @@ -31,8 +31,8 @@ class PluginHelper { */ generateLinks = (plugins: any[]): { name: string; url: string }[] => { return plugins - .filter((plugin) => plugin.enabled) - .map((installedPlugin) => { + .filter((plugin: any) => plugin.enabled) + .map((installedPlugin: any) => { return { name: installedPlugin.name, url: `/plugin/${installedPlugin.component.toLowerCase()}`,