mirror of https://github.com/langgenius/dify.git
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:
parent
8e600f3302
commit
ff30395dc1
|
|
@ -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',
|
||||
|
|
|
|||
Loading…
Reference in New Issue