mirror of
https://github.com/langgenius/dify.git
synced 2026-01-08 07:14:14 +00:00
doc(api): improve comments for better understanding in TriggerSubscriptionUpdateApi and TriggerProviderService
This commit is contained in:
@@ -353,7 +353,8 @@ class TriggerSubscriptionUpdateApi(Resource):
|
||||
# For rename only, just update the name
|
||||
rename = request.name is not None and not any((request.credentials, request.parameters, request.properties))
|
||||
# When credential type is UNAUTHORIZED, it indicates the subscription was manually created
|
||||
# For Manually created subscription, they dont have credentials, parameters, only name and properties(which is input by user)
|
||||
# For Manually created subscription, they dont have credentials, parameters
|
||||
# They only have name and properties(which is input by user)
|
||||
manually_created = subscription.credential_type == CredentialType.UNAUTHORIZED
|
||||
if rename or manually_created:
|
||||
TriggerProviderService.update_trigger_subscription(
|
||||
@@ -364,7 +365,8 @@ class TriggerSubscriptionUpdateApi(Resource):
|
||||
)
|
||||
return 200
|
||||
|
||||
# For the rest cases(API_KEY, OAUTH2), we need to call third party provider(e.g. GitHub API) to rebuild the subscription
|
||||
# For the rest cases(API_KEY, OAUTH2)
|
||||
# we need to call third party provider(e.g. GitHub) to rebuild the subscription
|
||||
TriggerProviderService.rebuild_trigger_subscription(
|
||||
tenant_id=user.current_tenant_id,
|
||||
name=request.name,
|
||||
|
||||
@@ -853,7 +853,7 @@ class TriggerProviderService:
|
||||
"""
|
||||
Create a subscription builder for rebuilding an existing subscription.
|
||||
|
||||
This method rebuild the subscription by calling DELETE and CREATE API of the third party provider(e.g. GitHub API)
|
||||
This method rebuild the subscription by call DELETE and CREATE API of the third party provider(e.g. GitHub)
|
||||
keeping the same subscription_id and endpoint_id so the webhook URL remains unchanged.
|
||||
|
||||
:param tenant_id: Tenant ID
|
||||
|
||||
Reference in New Issue
Block a user