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.
This commit is contained in:
Harry 2025-09-09 00:10:04 +08:00
parent 8e600f3302
commit ff30395dc1
1 changed files with 3 additions and 5 deletions

View File

@ -59,9 +59,7 @@ const OAuthClientConfigModal: FC<OAuthClientConfigModalProps> = ({
const [tempCredential, setTempCredential] = useState<Record<string, any>>({})
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<OAuthClientConfigModalProps> = ({
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',