From f34a6314a48f5517c46a41c503ab20ccee32dc75 Mon Sep 17 00:00:00 2001 From: "kai.arrowood" Date: Fri, 27 Oct 2023 12:58:24 -0400 Subject: [PATCH] fix(*): fetch condition --- .../src/components/PluginSelectGrid.vue | 32 ++++++++----------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/packages/entities/entities-plugins/src/components/PluginSelectGrid.vue b/packages/entities/entities-plugins/src/components/PluginSelectGrid.vue index 8caf6eb4b4..264ac7b815 100644 --- a/packages/entities/entities-plugins/src/components/PluginSelectGrid.vue +++ b/packages/entities/entities-plugins/src/components/PluginSelectGrid.vue @@ -344,28 +344,22 @@ onMounted(async () => { isLoading.value = true emit('loading', isLoading.value) - // only fetch available plugins if needed - if (props.onlyAvailablePlugins) { - try { - const res = await axiosInstance.get(availablePluginsUrl.value) - - // TODO: endpoints temporarily return different formats - if (props.config.app === 'konnect') { - const { names: available } = res.data - availablePlugins.value = available || [] - } else if (props.config.app === 'kongManager') { - const { plugins: { available_on_server: aPlugins } } = res.data - availablePlugins.value = aPlugins ? Object.keys(aPlugins) : [] - } - - pluginsList.value = buildPluginList() - emit('plugin-list-updated', pluginsList.value) - } catch (error: any) { - fetchErrorMessage.value = getMessageFromError(error) + try { + const res = await axiosInstance.get(availablePluginsUrl.value) + + // TODO: endpoints temporarily return different formats + if (props.config.app === 'konnect') { + const { names: available } = res.data + availablePlugins.value = available || [] + } else if (props.config.app === 'kongManager') { + const { plugins: { available_on_server: aPlugins } } = res.data + availablePlugins.value = aPlugins ? Object.keys(aPlugins) : [] } - } else { + pluginsList.value = buildPluginList() emit('plugin-list-updated', pluginsList.value) + } catch (error: any) { + fetchErrorMessage.value = getMessageFromError(error) } isLoading.value = false