From 7186bc36fb65036b4c82acf26a17f92ce5c9a6c0 Mon Sep 17 00:00:00 2001 From: Aleksandr Movchan Date: Fri, 31 Jan 2025 16:30:54 +0000 Subject: [PATCH] Add optional ID field to webhook registration response --- aana/api/request_handler.py | 4 +++- aana/api/webhook.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/aana/api/request_handler.py b/aana/api/request_handler.py index fa4e3ad5..2de7d3ec 100644 --- a/aana/api/request_handler.py +++ b/aana/api/request_handler.py @@ -370,4 +370,6 @@ async def register_webhook( webhook_repo.save(webhook) except Exception: return WebhookRegistrationResponse(message="Failed to register webhook") - return WebhookRegistrationResponse(message="Webhook registered successfully") + return WebhookRegistrationResponse( + id=str(webhook.id), message="Webhook registered successfully" + ) diff --git a/aana/api/webhook.py b/aana/api/webhook.py index a2d8769e..bab30184 100644 --- a/aana/api/webhook.py +++ b/aana/api/webhook.py @@ -38,7 +38,7 @@ class WebhookRegistrationRequest(BaseModel): class WebhookRegistrationResponse(BaseModel): """Response for a webhook registration.""" - id: str + id: str | None message: str