doc(api): improve comments for better understanding in TriggerSubscriptionUpdateApi and TriggerProviderService

This commit is contained in:
Harry
2025-12-29 19:58:42 +08:00
parent 1ddaece735
commit 16aa9254ad
2 changed files with 5 additions and 3 deletions

View File

@@ -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,

View File

@@ -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