From ff30395dc1ad7257b438a631064b039f4dcf2152 Mon Sep 17 00:00:00 2001 From: Harry Date: Tue, 9 Sep 2025 00:10:04 +0800 Subject: [PATCH] fix(OAuthClientConfigModal): simplify provider path handling in OAuth configuration - Updated the provider path handling in `OAuthClientConfigModal` to directly use `provider.name` instead of constructing a path with `provider.plugin_id` and `provider.name`. - Adjusted the corresponding calls to `invalidateOAuthConfig` and `configureTriggerOAuth` to reflect this change. These modifications enhance code clarity and streamline the OAuth configuration process in the trigger plugin component. --- .../components/oauth-client-config-modal.tsx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/web/app/components/workflow/nodes/trigger-plugin/components/oauth-client-config-modal.tsx b/web/app/components/workflow/nodes/trigger-plugin/components/oauth-client-config-modal.tsx index 882989f56d..15657dbb5b 100644 --- a/web/app/components/workflow/nodes/trigger-plugin/components/oauth-client-config-modal.tsx +++ b/web/app/components/workflow/nodes/trigger-plugin/components/oauth-client-config-modal.tsx @@ -59,9 +59,7 @@ const OAuthClientConfigModal: FC = ({ const [tempCredential, setTempCredential] = useState>({}) const [isLoading, setIsLoading] = useState(false) - const providerPath = `${provider.plugin_id}/${provider.name}` - - const { data: oauthConfig, isLoading: isLoadingConfig } = useTriggerOAuthConfig(providerPath) + const { data: oauthConfig, isLoading: isLoadingConfig } = useTriggerOAuthConfig(provider.name) const configureTriggerOAuth = useConfigureTriggerOAuth() const invalidateOAuthConfig = useInvalidateTriggerOAuthConfig() @@ -103,13 +101,13 @@ const OAuthClientConfigModal: FC = ({ try { await configureTriggerOAuth.mutateAsync({ - provider: providerPath, + provider: provider.name, client_params: convertToOAuthClientParams(tempCredential), enabled: true, }) // Invalidate cache - invalidateOAuthConfig(providerPath) + invalidateOAuthConfig(provider.name) notify({ type: 'success',